@mintlify/cli 4.1.82 → 4.1.84

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,7 +4,7 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{B as r,C as i,D as a,G as o,J as s,L as c,N as l,R as u,V as d,W as f,Y as p,a as m,b as h,d as g,et as _,f as v,g as y,m as b,nt as x,p as S,q as C,r as w,t as T,v as E,y as D}from"./dist-Cgbskz5I.js";import{$t as O,Bn as k,Cn as A,Fn as ee,Gt as j,Hn as te,In as ne,Ln as re,Mn as ie,Nn as ae,Qt as oe,Rn as se,St as ce,Tt as le,Vn as ue,Vt as de,Y as fe,Yn as pe,Zn as me,ir as he,it as ge,jn as _e,kn as ve,lr as ye,m as be,nt as xe,or as Se,ot as Ce,s as we,tr as Te,tt as Ee,wt as De,zt as Oe}from"./dist-Ds9rgRXa.js";import{g as ke,h as M,m as Ae}from"./build-dp785b-C.js";import{a as je,i as Me,n as Ne}from"./multi-repo-command-DmTEZuwj.js";import{c as Pe,l as Fe,n as Ie,t as Le,u as Re}from"./agent-Da2kI1tZ.js";import{A as ze,C as Be,D as Ve,E as He,F as Ue,I as We,L as N,M as Ge,N as Ke,O as qe,P as Je,R as Ye,S as Xe,T as Ze,_ as Qe,a as $e,b as et,c as tt,d as nt,f as rt,g as it,h as at,i as ot,j as st,k as ct,l as lt,m as ut,n as dt,o as ft,p as pt,r as mt,s as ht,t as gt,u as _t,v as vt,w as yt,x as bt,y as xt,z as St}from"./config-DLwNRkEH.js";import{n as Ct,t as wt}from"./client-DXQ6Tgw0.js";import{_ as Tt,a as Et,b as Dt,c as Ot,d as kt,f as At,g as jt,h as Mt,i as Nt,l as Pt,m as Ft,n as It,o as Lt,p as Rt,r as zt,s as Bt,t as Vt,u as Ht,v as Ut}from"./esm-Bzf2rZuk.js";import{S as Wt,_ as Gt,a as Kt,b as qt,c as Jt,d as Yt,f as Xt,g as Zt,h as Qt,i as $t,l as en,m as tn,o as nn,p as rn,r as an,s as on,u as sn,v as cn,x as ln,y as un}from"./live-BR7YGuvT.js";import{P as dn,dt as fn,tt as pn}from"./utils-B1yewEzF.js";import{n as mn}from"./remark-utils-FAwkaMKD.js";import{_ as hn,a as gn,c as _n,d as vn,f as yn,l as bn,m as xn,o as Sn,p as Cn,s as wn,u as Tn,v as En}from"./schemas-CVKidklE.js";import{t as Dn}from"./currencyMath-DWVndHDc.js";import{createRequire as On}from"node:module";import kn from"path";import{existsSync as An,readFileSync as jn,readdirSync as Mn}from"node:fs";import{execFile as Nn,spawn as Pn}from"node:child_process";import Fn from"node:os";import In from"node:path";import{createHash as Ln,randomUUID as Rn}from"node:crypto";import{fileURLToPath as zn}from"node:url";import{format as Bn,stripVTControlCharacters as Vn}from"node:util";import Hn,{mkdir as Un,mkdtemp as Wn,readFile as Gn,writeFile as Kn}from"node:fs/promises";import qn from"node:process";import Jn,{promises as Yn}from"fs";import Xn from"crypto";import{createRequire as Zn}from"module";import Qn from"os";import{setTimeout as $n}from"node:timers/promises";var P=x();const er=(e,t)=>{let n=t.a+e.a-t.a*e.a;if(n===0)return{r:0,g:0,b:0,a:0};let r=t.a/n,i=(e,t)=>Math.round((1-r)*e+r*t);return{r:i(e.r,t.r),g:i(e.g,t.g),b:i(e.b,t.b),a:n}},tr=e=>{let t=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(!t)throw TypeError(`Expected a valid hex string, got ${e}`);let n=t.length<6?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n.slice(0,6),16);return{red:r>>16,green:r>>8&255,blue:r&255,alpha:n.length===8?Number.parseInt(n.slice(6,8),16)/255:1}},nr=e=>{try{let t=tr(e);return`${t.red} ${t.green} ${t.blue}`}catch{return`0 0 0`}},rr=e=>`${e.r} ${e.g} ${e.b}`,ir=e=>`#${e.r.toString(16).padStart(2,`0`)}${e.g.toString(16).padStart(2,`0`)}${e.b.toString(16).padStart(2,`0`)}`,ar=(e,t,n)=>{if(t)return n?t:nr(t);let r=or(`#09090b`,1,e,.02);return n?ir(r):rr(r)},or=(e,t,n,r)=>{let i=tr(e),a=tr(n);return er({r:i.red,g:i.green,b:i.blue,a:t},{r:a.red,g:a.green,b:a.blue,a:r})},sr=`#4ADE80`,cr=(e=sr)=>({light:`#ffffff`,dark:ar(e,void 0,!0)});function lr(e){let t=e?.colors.primary||`#16A34A`,n=e?.colors.light??sr;e?.theme===`linden`&&(e.background=Object.assign(Object.assign({},e.background),{color:{light:e.background?.color?.light||ir(or(`#FFFFFF`,1,t,.03)),dark:e.background?.color?.dark||ir(or(`#09090B`,1,n,.03))}}));let r=e?.background?.color?.light??`#ffffff`;return{light:nr(r),dark:ar(n,e?.background?.color?.dark),lightHex:r,darkHex:ar(n,e?.background?.color?.dark,!0),background:e?.thumbnails?.background}}var F=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ur=/([A-Z])/g,dr=e=>e.replace(ur,`-$1`).toLowerCase(),fr={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},pr=/[&><"']/g,mr=e=>String(e).replace(pr,e=>fr[e]),hr=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?hr(e.body[0]):e:e.type===`font`?hr(e.body):e,gr=/* @__PURE__ */ new Set([`mathord`,`textord`,`atom`]),_r=e=>gr.has(hr(e).type),vr=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},yr={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function br(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function xr(e){return e.default===void 0?br(Array.isArray(e.type)?e.type[0]:e.type):e.default}function Sr(e,t,n,r){var i=n[t];e[t]=i===void 0?xr(r):r.processor?r.processor(i):i}var Cr=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(yr)){var n=yr[t];n&&Sr(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new F(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=vr(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},wr=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Nr[Pr[this.id]]}sub(){return Nr[Fr[this.id]]}fracNum(){return Nr[Ir[this.id]]}fracDen(){return Nr[Lr[this.id]]}cramp(){return Nr[Rr[this.id]]}text(){return Nr[zr[this.id]]}isTight(){return this.size>=2}},Tr=0,Er=1,Dr=2,Or=3,kr=4,Ar=5,jr=6,Mr=7,Nr=[new wr(Tr,0,!1),new wr(Er,0,!0),new wr(Dr,1,!1),new wr(Or,1,!0),new wr(kr,2,!1),new wr(Ar,2,!0),new wr(jr,3,!1),new wr(Mr,3,!0)],Pr=[kr,Ar,kr,Ar,jr,Mr,jr,Mr],Fr=[Ar,Ar,Ar,Ar,Mr,Mr,Mr,Mr],Ir=[Dr,Or,kr,Ar,jr,Mr,jr,Mr],Lr=[Or,Or,Ar,Ar,Mr,Mr,Mr,Mr],Rr=[Er,Er,Or,Or,Ar,Ar,Mr,Mr],zr=[Tr,Er,Dr,Or,Dr,Or,Dr,Or],Br={DISPLAY:Nr[Tr],TEXT:Nr[Dr],SCRIPT:Nr[kr],SCRIPTSCRIPT:Nr[jr]},Vr=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Hr(e){for(var t=0;t<Vr.length;t++)for(var n=Vr[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Ur=[];Vr.forEach(e=>e.blocks.forEach(e=>Ur.push(...e)));function Wr(e){for(var t=0;t<Ur.length;t+=2)if(e>=Ur[t]&&e<=Ur[t+1])return!0;return!1}var Gr=e=>e+` `+e,Kr=80,qr=function(e,t){return`M95,`+(622+e+t)+`
7
+ import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{B as r,C as i,D as a,G as o,J as s,L as c,N as l,R as u,V as d,W as f,Y as p,a as m,b as h,d as g,et as _,f as v,g as y,m as b,nt as x,p as S,q as C,r as w,t as T,v as E,y as D}from"./dist-DxjIV9Q5.js";import{$t as O,Bn as k,Cn as A,Fn as ee,Gt as j,Hn as te,In as ne,Ln as re,Mn as ie,Nn as ae,Qt as oe,Rn as se,St as ce,Tt as le,Vn as ue,Vt as de,Y as fe,Yn as pe,Zn as me,ir as he,it as ge,jn as _e,kn as ve,lr as ye,m as be,nt as xe,or as Se,ot as Ce,s as we,tr as Te,tt as Ee,wt as De,zt as Oe}from"./dist-BAndNTcP.js";import{g as ke,h as M,m as Ae}from"./build-dp785b-C.js";import{a as je,i as Me,n as Ne}from"./multi-repo-command-CipHiXuw.js";import{c as Pe,l as Fe,n as Ie,t as Le,u as Re}from"./agent-Da2kI1tZ.js";import{A as ze,C as Be,D as Ve,E as He,F as Ue,I as We,L as N,M as Ge,N as Ke,O as qe,P as Je,R as Ye,S as Xe,T as Ze,_ as Qe,a as $e,b as et,c as tt,d as nt,f as rt,g as it,h as at,i as ot,j as st,k as ct,l as lt,m as ut,n as dt,o as ft,p as pt,r as mt,s as ht,t as gt,u as _t,v as vt,w as yt,x as bt,y as xt,z as St}from"./config-D-3PjtVl.js";import{n as Ct,t as wt}from"./client-DXQ6Tgw0.js";import{_ as Tt,a as Et,b as Dt,c as Ot,d as kt,f as At,g as jt,h as Mt,i as Nt,l as Pt,m as Ft,n as It,o as Lt,p as Rt,r as zt,s as Bt,t as Vt,u as Ht,v as Ut}from"./esm-Bzf2rZuk.js";import{S as Wt,_ as Gt,a as Kt,b as qt,c as Jt,d as Yt,f as Xt,g as Zt,h as Qt,i as $t,l as en,m as tn,o as nn,p as rn,r as an,s as on,u as sn,v as cn,x as ln,y as un}from"./live-CND-3fI5.js";import{P as dn,dt as fn,tt as pn}from"./utils-B1yewEzF.js";import{n as mn}from"./remark-utils-FAwkaMKD.js";import{_ as hn,a as gn,c as _n,d as vn,f as yn,l as bn,m as xn,o as Sn,p as Cn,s as wn,u as Tn,v as En}from"./schemas-CVKidklE.js";import{t as Dn}from"./currencyMath-DWVndHDc.js";import{createRequire as On}from"node:module";import kn from"path";import{existsSync as An,readFileSync as jn,readdirSync as Mn}from"node:fs";import{execFile as Nn,spawn as Pn}from"node:child_process";import Fn from"node:os";import In from"node:path";import{createHash as Ln,randomUUID as Rn}from"node:crypto";import{fileURLToPath as zn}from"node:url";import{format as Bn,stripVTControlCharacters as Vn}from"node:util";import Hn,{mkdir as Un,mkdtemp as Wn,readFile as Gn,writeFile as Kn}from"node:fs/promises";import qn from"node:process";import Jn,{promises as Yn}from"fs";import Xn from"crypto";import{createRequire as Zn}from"module";import Qn from"os";import{setTimeout as $n}from"node:timers/promises";var P=x();const er=(e,t)=>{let n=t.a+e.a-t.a*e.a;if(n===0)return{r:0,g:0,b:0,a:0};let r=t.a/n,i=(e,t)=>Math.round((1-r)*e+r*t);return{r:i(e.r,t.r),g:i(e.g,t.g),b:i(e.b,t.b),a:n}},tr=e=>{let t=/^#?([0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/i.exec(e)?.[1];if(!t)throw TypeError(`Expected a valid hex string, got ${e}`);let n=t.length<6?[...t].map(e=>e+e).join(``):t,r=Number.parseInt(n.slice(0,6),16);return{red:r>>16,green:r>>8&255,blue:r&255,alpha:n.length===8?Number.parseInt(n.slice(6,8),16)/255:1}},nr=e=>{try{let t=tr(e);return`${t.red} ${t.green} ${t.blue}`}catch{return`0 0 0`}},rr=e=>`${e.r} ${e.g} ${e.b}`,ir=e=>`#${e.r.toString(16).padStart(2,`0`)}${e.g.toString(16).padStart(2,`0`)}${e.b.toString(16).padStart(2,`0`)}`,ar=(e,t,n)=>{if(t)return n?t:nr(t);let r=or(`#09090b`,1,e,.02);return n?ir(r):rr(r)},or=(e,t,n,r)=>{let i=tr(e),a=tr(n);return er({r:i.red,g:i.green,b:i.blue,a:t},{r:a.red,g:a.green,b:a.blue,a:r})},sr=`#4ADE80`,cr=(e=sr)=>({light:`#ffffff`,dark:ar(e,void 0,!0)});function lr(e){let t=e?.colors.primary||`#16A34A`,n=e?.colors.light??sr;e?.theme===`linden`&&(e.background=Object.assign(Object.assign({},e.background),{color:{light:e.background?.color?.light||ir(or(`#FFFFFF`,1,t,.03)),dark:e.background?.color?.dark||ir(or(`#09090B`,1,n,.03))}}));let r=e?.background?.color?.light??`#ffffff`;return{light:nr(r),dark:ar(n,e?.background?.color?.dark),lightHex:r,darkHex:ar(n,e?.background?.color?.dark,!0),background:e?.thumbnails?.background}}var F=class e extends Error{constructor(t,n){var r=`KaTeX parse error: `+t,i,a,o=n&&n.loc;if(o&&o.start<=o.end){var s=o.lexer.input;i=o.start,a=o.end,i===s.length?r+=` at end of input: `:r+=` at position `+(i+1)+`: `;var c=s.slice(i,a).replace(/[^]/g,`$&̲`),l=i>15?`…`+s.slice(i-15,i):s.slice(0,i),u=a+15<s.length?s.slice(a,a+15)+`…`:s.slice(a);r+=l+c+u}super(r),this.name=`ParseError`,this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,e.prototype),this.position=i,i!=null&&a!=null&&(this.length=a-i),this.rawMessage=t}},ur=/([A-Z])/g,dr=e=>e.replace(ur,`-$1`).toLowerCase(),fr={"&":`&amp;`,">":`&gt;`,"<":`&lt;`,'"':`&quot;`,"'":`&#x27;`},pr=/[&><"']/g,mr=e=>String(e).replace(pr,e=>fr[e]),hr=e=>e.type===`ordgroup`||e.type===`color`?e.body.length===1?hr(e.body[0]):e:e.type===`font`?hr(e.body):e,gr=/* @__PURE__ */ new Set([`mathord`,`textord`,`atom`]),_r=e=>gr.has(hr(e).type),vr=e=>{var t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?t[2]!==`:`||!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?null:t[1].toLowerCase():`_relative`},yr={displayMode:{type:`boolean`,description:`Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.`,cli:`-d, --display-mode`},output:{type:{enum:[`htmlAndMathml`,`html`,`mathml`]},description:`Determines the markup language of the output.`,cli:`-F, --format <type>`},leqno:{type:`boolean`,description:`Render display math in leqno style (left-justified tags).`},fleqn:{type:`boolean`,description:`Render display math flush left.`},throwOnError:{type:`boolean`,default:!0,cli:`-t, --no-throw-on-error`,cliDescription:`Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error.`},errorColor:{type:`string`,default:`#cc0000`,cli:`-c, --error-color <color>`,cliDescription:`A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.`,cliProcessor:e=>`#`+e},macros:{type:`object`,cli:`-m, --macro <def>`,cliDescription:`Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).`,cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:`number`,description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:`--min-rule-thickness <size>`,cliProcessor:parseFloat},colorIsTextColor:{type:`boolean`,description:`Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.`,cli:`-b, --color-is-text-color`},strict:{type:[{enum:[`warn`,`ignore`,`error`]},`boolean`,`function`],description:`Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.`,cli:`-S, --strict`,cliDefault:!1},trust:{type:[`boolean`,`function`],description:`Trust the input, enabling all HTML features such as \\url.`,cli:`-T, --trust`},maxSize:{type:`number`,default:1/0,description:`If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large`,processor:e=>Math.max(0,e),cli:`-s, --max-size <n>`,cliProcessor:parseInt},maxExpand:{type:`number`,default:1e3,description:`Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.`,processor:e=>Math.max(0,e),cli:`-e, --max-expand <n>`,cliProcessor:e=>e===`Infinity`?1/0:parseInt(e)},globalGroup:{type:`boolean`,cli:!1}};function br(e){if(typeof e!=`string`)return e.enum[0];switch(e){case`boolean`:return!1;case`string`:return``;case`number`:return 0;case`object`:return{};default:throw Error(`Unexpected schema type; settings must declare an explicit default.`)}}function xr(e){return e.default===void 0?br(Array.isArray(e.type)?e.type[0]:e.type):e.default}function Sr(e,t,n,r){var i=n[t];e[t]=i===void 0?xr(r):r.processor?r.processor(i):i}var Cr=class{constructor(e){e===void 0&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e||={};for(var t of Object.keys(yr)){var n=yr[t];n&&Sr(this,t,e,n)}}reportNonstrict(e,t,n){var r=this.strict;if(typeof r==`function`&&(r=r(e,t,n)),r&&r!==`ignore`){if(r===!0||r===`error`)throw new F(`LaTeX-incompatible input and strict mode is set to 'error': `+(t+` [`+e+`]`),n);r===`warn`?typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)):typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`))}}useStrictBehavior(e,t,n){var r=this.strict;if(typeof r==`function`)try{r=r(e,t,n)}catch{r=`error`}return!r||r===`ignore`?!1:r===!0||r===`error`?!0:r===`warn`?(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to 'warn': `+(t+` [`+e+`]`)),!1):(typeof console<`u`&&console.warn(`LaTeX-incompatible input and strict mode is set to `+(`unrecognized '`+r+`': `+t+` [`+e+`]`)),!1)}isTrusted(e){if(`url`in e&&e.url&&!e.protocol){var t=vr(e.url);if(t==null)return!1;e.protocol=t}return!!(typeof this.trust==`function`?this.trust(e):this.trust)}},wr=class{constructor(e,t,n){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=n}sup(){return Nr[Pr[this.id]]}sub(){return Nr[Fr[this.id]]}fracNum(){return Nr[Ir[this.id]]}fracDen(){return Nr[Lr[this.id]]}cramp(){return Nr[Rr[this.id]]}text(){return Nr[zr[this.id]]}isTight(){return this.size>=2}},Tr=0,Er=1,Dr=2,Or=3,kr=4,Ar=5,jr=6,Mr=7,Nr=[new wr(Tr,0,!1),new wr(Er,0,!0),new wr(Dr,1,!1),new wr(Or,1,!0),new wr(kr,2,!1),new wr(Ar,2,!0),new wr(jr,3,!1),new wr(Mr,3,!0)],Pr=[kr,Ar,kr,Ar,jr,Mr,jr,Mr],Fr=[Ar,Ar,Ar,Ar,Mr,Mr,Mr,Mr],Ir=[Dr,Or,kr,Ar,jr,Mr,jr,Mr],Lr=[Or,Or,Ar,Ar,Mr,Mr,Mr,Mr],Rr=[Er,Er,Or,Or,Ar,Ar,Mr,Mr],zr=[Tr,Er,Dr,Or,Dr,Or,Dr,Or],Br={DISPLAY:Nr[Tr],TEXT:Nr[Dr],SCRIPT:Nr[kr],SCRIPTSCRIPT:Nr[jr]},Vr=[{name:`latin`,blocks:[[256,591],[768,879]]},{name:`cyrillic`,blocks:[[1024,1279]]},{name:`armenian`,blocks:[[1328,1423]]},{name:`brahmic`,blocks:[[2304,4255]]},{name:`georgian`,blocks:[[4256,4351]]},{name:`cjk`,blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:`hangul`,blocks:[[44032,55215]]}];function Hr(e){for(var t=0;t<Vr.length;t++)for(var n=Vr[t],r=0;r<n.blocks.length;r++){var i=n.blocks[r];if(e>=i[0]&&e<=i[1])return n.name}return null}var Ur=[];Vr.forEach(e=>e.blocks.forEach(e=>Ur.push(...e)));function Wr(e){for(var t=0;t<Ur.length;t+=2)if(e>=Ur[t]&&e<=Ur[t+1])return!0;return!1}var Gr=e=>e+` `+e,Kr=80,qr=function(e,t){return`M95,`+(622+e+t)+`
8
8
  c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
9
9
  c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
10
10
  c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
@@ -552,7 +552,7 @@ Next steps:`,`1. Clone the knowledge base into ./${i}:`,` git -c http.${r.remo
552
552
  Next steps:`,`1. Clone the hosted repository into a separate directory. Do not replace the user’s existing Git remote.`,`2. Copy the selected documentation into its root, including docs.json, .md/.mdx pages, images, and other required assets. Exclude credentials, .env files, node_modules, and .git.`,`3. Commit the documentation. For subsequent updates, fetch the hosted main branch and commit on top of it. Do not force-push.`,`4. Push to main. Supply the write token as an HTTP Authorization: Bearer header for this Git operation only; never embed it in the remote URL or persist it in Git config.`,`5. If the write token expires, run mint deploy again from the same documentation directory to obtain a fresh token.`,`A successful push starts the normal build. Provisioning and Git success do not confirm build success.`,``,`Git examples (POSIX shell): set REPOSITORY_URL and WRITE_TOKEN from the output above. Set CHECKOUT_DIR to a new directory outside the source documentation directory. Keep the token private and do not enable shell tracing.`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git clone "$REPOSITORY_URL" "$CHECKOUT_DIR"',`After copying and committing the documentation:`,'GIT_CONFIG_COUNT=1 GIT_CONFIG_KEY_0="http.${REPOSITORY_URL}.extraHeader" GIT_CONFIG_VALUE_0="Authorization: Bearer ${WRITE_TOKEN}" git -C "$CHECKOUT_DIR" push origin HEAD:main',`These settings apply only to that Git process. Use the same authentication settings for later fetches.`,``,...t?[`Claim link for the user: ${t}`,`Show this link to the user. They open it, sign in, and click Confirm; the site moves into their account. Do not sign in on their behalf. There is no code to relay.`]:Wm].join(`
553
553
  `):``}var Jm=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Ym=yn({id:vn().int().positive(),full_name:xn().regex(/^[\w.-]+\/[\w.-]+$/),default_branch:xn().min(1)}),Xm=In.join(`.github`,`workflows`,`mintlify.yml`);function Zm(e,t,n){return new Promise((r,i)=>{Nn(e,t,{cwd:n},(e,t)=>e?i(e):r(String(t).trim()))})}function Qm(e){let t=e.trim().match(/^(?:https:\/\/(?:[^@/]+@)?github\.com\/|ssh:\/\/git@github\.com(?::\d+)?\/|git@github\.com:)([\w.-]+)\/([\w.-]+?)(?:\.git)?\/?$/);return t?.[1]&&t[2]?{owner:t[1],repo:t[2]}:null}function $m(e,t,n=``){let r=/^[\w./-]+$/.test(n)?n:JSON.stringify(n);return[`name: Deploy to Mintlify`,`on:`,` push:`,` branches: [${JSON.stringify(e)}]`,...n?[` paths: [${JSON.stringify(`${n}/**`)}, ".github/workflows/mintlify.yml"]`]:[],`permissions:`,` id-token: write`,` contents: read`,`concurrency:`,` group: mintlify-deploy`,` cancel-in-progress: true`,`jobs:`,` deploy:`,` runs-on: ubuntu-latest`,` steps:`,` - uses: actions/checkout@v4`,` - run: npx mint@latest deploy --subdomain ${t}${n?` --directory ${r}`:``}`,``].join(`
554
554
  `)}function eh(e){return Jm(this,void 0,void 0,function*(){return Hn.readFile(e,`utf8`).catch(e=>{if(e.code!==`ENOENT`)throw e})})}function th(e,t){return Jm(this,arguments,void 0,function*(e,t,n=!1){let r=In.join(e,Xm),i=yield eh(r);if(i===t)return`unchanged`;if(i!==void 0&&!n)throw Error(`${Xm} already exists with different contents. Pass --force to overwrite it.`);return yield Hn.mkdir(In.dirname(r),{recursive:!0}),yield Hn.writeFile(r,t),i===void 0?`created`:`updated`})}function nh(e){return Jm(this,void 0,void 0,function*(){try{return yield Zm(`git`,[`rev-parse`,`--show-toplevel`],e)}catch{throw Error(`--github requires a Git repository. Run it inside your docs repository.`)}})}function rh(e){return Jm(this,void 0,void 0,function*(){let t=yield Zm(`git`,[`remote`,`get-url`,`origin`],e).catch(()=>{throw Error(`This repository has no origin remote. Add a github.com origin and retry.`)}),n=Qm(t);if(!n)throw Error(`The origin remote (${t}) is not a github.com repository.`);let r=yield Zm(`gh`,[`api`,`repos/${n.owner}/${n.repo}`,`--jq`,`{id: .id, full_name: .full_name, default_branch: .default_branch}`],e).catch(e=>{throw e.code===`ENOENT`?Error("The GitHub CLI (gh) is required. Install it and run `gh auth login`."):Error(`Could not read ${n.owner}/${n.repo} with gh. Run \`gh auth login\` with access to the repository and retry.`)});try{return Ym.parse(JSON.parse(r))}catch{throw Error(`gh returned an unexpected repository response.`)}})}function ih(e,t){return Jm(this,arguments,void 0,function*(e,t,n=()=>{}){let r=In.resolve(e.directory),i=yield nh(r),[a,o]=yield Promise.all([Hn.realpath(i),Hn.realpath(r)]),s=In.relative(a,o).split(In.sep).join(`/`);if(!(yield eh(In.join(r,`docs.json`))))throw Error(`No docs.json in ${r}. Pass the docs folder with --directory.`);n(`Resolving the GitHub repository...`);let c=yield rh(i),l=yield Am(e,t,n);if(l.status===`claimed`)throw Error(`This site has been claimed. Setting up GitHub deploys for claimed sites is not supported yet; connect the repository from the Mintlify dashboard.`);let u=l.credentials.accessToken;if(!u)throw Error(`Agent authentication did not return an access token.`);n(`Trusting ${c.full_name}@${c.default_branch} to deploy...`),yield Om(e.apiUrl,u,{repositoryId:String(c.id),repository:c.full_name,branch:c.default_branch});let d=yield th(i,$m(c.default_branch,l.site.subdomain,s),e.force);return{siteUrl:jm(e.apiUrl,l.site.subdomain),subdomain:l.site.subdomain,repository:c.full_name,branch:c.default_branch,workflowPath:Xm,workflow:d}})}function ah(e){return[`Site: ${e.siteUrl}`,`Trusted repository: ${e.repository} (branch ${e.branch})`,`Workflow: ${e.workflowPath} (${e.workflow})`,``,`Next steps:`,`1. Commit and push ${e.workflowPath} to ${e.branch}.`,`2. Every push to ${e.branch} then deploys ${e.subdomain} through GitHub Actions. No secrets are stored in the repository.`,``,...Wm].join(`
555
- `)}var oh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const sh=[`bug`,`docs`,`idea`];function ch(e){return oh(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${rt}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function lh(e){return oh(this,void 0,void 0,function*(){let t=yield ch(e);return D(t?(0,P.jsx)(c,{message:t}):(0,P.jsx)(o,{message:`feedback sent`})),!t})}var uh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},dh=function(e){return this instanceof dh?(this.v=e,this):new dh(e)},fh=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},ph=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:dh(e[r](t)),done:!1}:i?i(t):t}:i}},mh=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof dh?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function hh(){return uh(this,void 0,void 0,function*(){try{let e=yield Hn.readFile(In.join(et,`.gitignore`),`utf-8`);return le(e)}catch{return[]}})}function gh(e,t){return mh(this,arguments,function*(){let n=yield dh(Hn.readdir(e,{withFileTypes:!0}));for(let r of n){let n=In.join(e,r.name),i=In.relative(et,n).split(In.sep).join(`/`);De(i,t,r.isDirectory())||(r.isDirectory()?yield dh(yield*ph(fh(gh(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield dh(n)))}})}const _h=()=>uh(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:s}=yield import(`./converter-D-AXgjro.js`),l=[...yield hh(),...yield ge(et)],u=ce(l),d=0,f=0,p=0;try{for(var m=!0,h=fh(gh(et,u)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;d++;let t=In.relative(et,e);try{let t=yield Hn.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:o}=i(n);e===0&&(r=Object.keys(o).length);let c=`${a(t,Object.assign({frontmatter:o},s))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Hn.writeFile(e,n),f++)}catch(e){p++,D((0,P.jsx)(c,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!m&&!e&&(n=h.return)&&(yield n.call(h))}finally{if(t)throw t.error}}D((0,P.jsx)(o,{message:`formatted ${f} of ${d} mdx file${d===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var vh=/* @__PURE__ */ n(((e,t)=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}})),yh=/* @__PURE__ */ n((e=>{let t={INVALID_LOC:`Invalid LOC header (bad signature)`,INVALID_CEN:`Invalid CEN header (bad signature)`,INVALID_END:`Invalid END header (bad signature)`,DESCRIPTOR_NOT_EXIST:`No descriptor present`,DESCRIPTOR_UNKNOWN:`Unknown descriptor format`,DESCRIPTOR_FAULTY:`Descriptor data is malformed`,NO_DATA:`Nothing to decompress`,BAD_CRC:`CRC32 checksum failed {0}`,FILE_IN_THE_WAY:`There is a file in the way: {0}`,UNKNOWN_METHOD:`Invalid/unsupported compression method`,AVAIL_DATA:`inflate::Available inflate data did not terminate`,INVALID_DISTANCE:`inflate::Invalid literal/length or distance code in fixed or dynamic block`,TO_MANY_CODES:`inflate::Dynamic block code description: too many length or distance codes`,INVALID_REPEAT_LEN:`inflate::Dynamic block code description: repeat more than specified lengths`,INVALID_REPEAT_FIRST:`inflate::Dynamic block code description: repeat lengths with no first length`,INCOMPLETE_CODES:`inflate::Dynamic block code description: code lengths codes incomplete`,INVALID_DYN_DISTANCE:`inflate::Dynamic block code description: invalid distance code lengths`,INVALID_CODES_LEN:`inflate::Dynamic block code description: invalid literal/length code lengths`,INVALID_STORE_BLOCK:`inflate::Stored block length did not match one's complement`,INVALID_BLOCK_TYPE:`inflate::Invalid block type (type == 3)`,CANT_EXTRACT_FILE:`Could not extract the file`,CANT_OVERRIDE:`Target file already exists`,DISK_ENTRY_TOO_LARGE:`Number of disk entries is too large`,NO_ZIP:`No zip file was loaded`,NO_ENTRY:`Entry doesn't exist`,DIRECTORY_CONTENT_ERROR:`A directory cannot have content`,FILE_NOT_FOUND:`File not found: "{0}"`,NOT_IMPLEMENTED:`Not implemented`,INVALID_FILENAME:`Invalid filename`,INVALID_FORMAT:`Invalid or unsupported zip format. No END header found`,INVALID_PASS_PARAM:`Incompatible password parameter`,WRONG_PASSWORD:`Wrong Password`,COMMENT_TOO_LONG:`Comment is too long`,EXTRA_FIELD_PARSE_ERROR:`Extra field parsing error`};function n(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||``)),/* @__PURE__ */ Error(`ADM-ZIP: `+e)}}for(let r of Object.keys(t))e[r]=n(t[r])})),bh=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=vh(),o=yh(),s=typeof process==`object`&&process.platform===`win32`,c=e=>typeof e==`object`&&!!e,l=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;return t>>>0});function u(e){this.sep=i.sep,this.fs=r,c(e)&&c(e.fs)&&typeof e.fs.statSync==`function`&&(this.fs=e.fs)}n.exports=u,u.prototype.makeDir=function(e){let t=this;function n(e){let n=e.split(t.sep)[0];e.split(t.sep).forEach(function(e){if(e&&e.substr(-1,1)!==`:`){n+=t.sep+e;var r;try{r=t.fs.statSync(n)}catch(e){if(e.message&&e.message.startsWith(`ENOENT`))t.fs.mkdirSync(n);else throw e}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${n}"`)}})}n(e)},u.prototype.writeFileTo=function(e,t,n,r){let a=this;if(a.fs.existsSync(e)&&(!n||a.fs.statSync(e).isDirectory()))return!1;var o=i.dirname(e);a.fs.existsSync(o)||a.makeDir(o);var s;try{s=a.fs.openSync(e,`w`,438)}catch{a.fs.chmodSync(e,438),s=a.fs.openSync(e,`w`,438)}if(s)try{a.fs.writeSync(s,t,0,t.length,0)}finally{a.fs.closeSync(s)}return a.fs.chmodSync(e,r||438),!0},u.prototype.writeFileToAsync=function(e,t,n,r,a){typeof r==`function`&&(a=r,r=void 0);let o=this;o.fs.exists(e,function(s){if(s&&!n)return a(!1);o.fs.stat(e,function(n,c){if(s&&c&&c.isDirectory())return a(!1);var l=i.dirname(e);o.fs.exists(l,function(n){if(!n)try{o.makeDir(l)}catch{return a(!1)}let i=function(n){o.fs.write(n,t,0,t.length,0,function(t){o.fs.close(n,function(){if(t)return a(!1);o.fs.chmod(e,r||438,function(){a(!0)})})})};o.fs.open(e,`w`,438,function(t,n){t?o.fs.chmod(e,438,function(){o.fs.open(e,`w`,438,function(e,t){if(e||!t)return a(!1);i(t)})}):n?i(n):a(!1)})})})})},u.prototype.findFiles=function(e){let t=this;function n(e,r,a,o){typeof r==`boolean`&&(a=r,r=void 0);let s=[];return t.fs.readdirSync(e).forEach(function(c){let l=i.join(e,c),u=t.fs.statSync(l);if((!r||r.test(l))&&s.push(i.normalize(l)+(u.isDirectory()?t.sep:``)),u.isDirectory()&&a){let e=t.fs.realpathSync(l);o.has(e)||(o.add(e),s=s.concat(n(l,r,a,o)))}}),s}return n(e,void 0,!0,/* @__PURE__ */ new Set([t.fs.realpathSync(e)]))},u.prototype.findFilesAsync=function(e,t){let n=this,r=[],a=!1,o=function(e){a||(a=!0,t(e,e?void 0:r))},s=function(e,t,a){n.fs.readdir(e,function(o,c){if(o)return a(o);let l=c.length;if(!l)return a();c.forEach(function(o){let c=i.join(e,o);n.fs.stat(c,function(e,o){if(e)return a(e);o?(r.push(i.normalize(c)+(o.isDirectory()?n.sep:``)),o.isDirectory()?n.fs.realpath(c,function(e,n){if(e)return a(e);t.has(n)?--l||a():(t.add(n),s(c,t,function(e){if(e)return a(e);--l||a()}))}):--l||a()):--l||a()})})})};n.fs.realpath(e,function(t,n){if(t)return o(t);s(e,/* @__PURE__ */ new Set([n]),o)})},u.prototype.getAttributes=function(){},u.prototype.setAttributes=function(){},u.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},u.crc32=function(e){typeof e==`string`&&(e=Buffer.from(e,`utf8`));let t=e.length,n=-1;for(let r=0;r<t;)n=u.crc32update(n,e[r++]);return~n>>>0},u.methodToString=function(e){switch(e){case a.STORED:return`STORED (`+e+`)`;case a.DEFLATED:return`DEFLATED (`+e+`)`;default:return`UNSUPPORTED (`+e+`)`}},u.canonical=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.join(`.`,t)},u.zipnamefix=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.posix.join(`.`,t)},u.findLast=function(e,t){if(!Array.isArray(e))throw TypeError(`arr is not array`);let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]},u.sanitize=function(e,t){e=i.resolve(i.normalize(e));for(var n=t.split(`/`),r=0,a=n.length;r<a;r++){var o=i.normalize(i.join(e,n.slice(r,a).join(i.sep)));if(o===e||o.startsWith(e+i.sep))return o}return i.normalize(i.join(e,i.basename(t)))},u.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e==`string`?t(e):Buffer.alloc(0)},u.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n},u.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)},u.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)},u.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n},u.isWin=s,u.crcTable=l})),xh=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports=function(e,{fs:t}){var n=e||``,i=o(),a=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(a=t.statSync(n),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=!!(73&a.mode),i.readonly=!(128&a.mode),i.hidden=r.basename(n)[0]===`.`):console.warn(`Invalid path: `+n),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Sh=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),Ch=/* @__PURE__ */ n(((e,t)=>{t.exports=bh(),t.exports.Constants=vh(),t.exports.Errors=yh(),t.exports.FileAttr=xh(),t.exports.decoder=Sh()})),wh=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=n.Constants;t.exports=function(){var e=20,t=10,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;e|=n.isWin?2560:768,i|=r.FLG_EFS;let _={extraLen:0},v=e=>Math.max(0,e)>>>0,y=e=>Math.max(0,e)&255;return o=n.fromDate2DOS(/* @__PURE__ */ new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return i},set flags(e){i=e},get flags_efs(){return(i&r.FLG_EFS)>0},set flags_efs(e){e?i|=r.FLG_EFS:i&=~r.FLG_EFS},get flags_desc(){return(i&r.FLG_DESC)>0},set flags_desc(e){e?i|=r.FLG_DESC:i&=~r.FLG_DESC},get method(){return a},set method(e){switch(e){case r.STORED:this.version=10;break;case r.DEFLATED:default:this.version=20}a=e},get time(){return n.fromDOS2Date(this.timeval)},set time(e){e=new Date(e),this.timeval=n.fromDate2DOS(e)},get timeval(){return o},set timeval(e){o=v(e)},get timeHighByte(){return y(o>>>8)},get crc(){return s},set crc(e){s=v(e)},get compressedSize(){return c},set compressedSize(e){c=v(e)},get size(){return l},set size(e){l=v(e)},get fileNameLength(){return u},set fileNameLength(e){u=e},get extraLength(){return d},set extraLength(e){d=e},get extraLocalLength(){return _.extraLen},set extraLocalLength(e){_.extraLen=e},get commentLength(){return f},set commentLength(e){f=e},get diskNumStart(){return p},set diskNumStart(e){p=v(e)},get inAttr(){return m},set inAttr(e){m=v(e)},get attr(){return h},set attr(e){h=v(e)},get fileAttr(){return(h||0)>>16&4095},get offset(){return g},set offset(e){g=v(e)},get encrypted(){return(i&r.FLG_ENC)===r.FLG_ENC},get centralHeaderSize(){return r.CENHDR+u+d+f},get realDataOffset(){return g+r.LOCHDR+_.fnameLen+_.extraLen},get localHeader(){return _},loadLocalHeaderFromBinary:function(e){var t=e.slice(g,g+r.LOCHDR);if(t.readUInt32LE(0)!==r.LOCSIG)throw n.Errors.INVALID_LOC();_.version=t.readUInt16LE(r.LOCVER),_.flags=t.readUInt16LE(r.LOCFLG),_.flags_desc=(_.flags&r.FLG_DESC)>0,_.method=t.readUInt16LE(r.LOCHOW),_.time=t.readUInt32LE(r.LOCTIM),_.crc=t.readUInt32LE(r.LOCCRC),_.compressedSize=t.readUInt32LE(r.LOCSIZ),_.size=t.readUInt32LE(r.LOCLEN),_.fnameLen=t.readUInt16LE(r.LOCNAM),_.extraLen=t.readUInt16LE(r.LOCEXT);let i=g+r.LOCHDR+_.fnameLen,a=i+_.extraLen;return e.slice(i,a)},loadFromBinary:function(_){if(_.length!==r.CENHDR||_.readUInt32LE(0)!==r.CENSIG)throw n.Errors.INVALID_CEN();e=_.readUInt16LE(r.CENVEM),t=_.readUInt16LE(r.CENVER),i=_.readUInt16LE(r.CENFLG),a=_.readUInt16LE(r.CENHOW),o=_.readUInt32LE(r.CENTIM),s=_.readUInt32LE(r.CENCRC),c=_.readUInt32LE(r.CENSIZ),l=_.readUInt32LE(r.CENLEN),u=_.readUInt16LE(r.CENNAM),d=_.readUInt16LE(r.CENEXT),f=_.readUInt16LE(r.CENCOM),p=_.readUInt16LE(r.CENDSK),m=_.readUInt16LE(r.CENATT),h=_.readUInt32LE(r.CENATX),g=_.readUInt32LE(r.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(r.LOCHDR);return e.writeUInt32LE(r.LOCSIG,0),e.writeUInt16LE(t,r.LOCVER),e.writeUInt16LE(i&~r.FLG_DESC,r.LOCFLG),e.writeUInt16LE(a,r.LOCHOW),e.writeUInt32LE(o,r.LOCTIM),e.writeUInt32LE(s,r.LOCCRC),e.writeUInt32LE(c,r.LOCSIZ),e.writeUInt32LE(l,r.LOCLEN),e.writeUInt16LE(u,r.LOCNAM),e.writeUInt16LE(_.extraLen,r.LOCEXT),e},centralHeaderToBinary:function(){var n=Buffer.alloc(r.CENHDR+u+d+f);return n.writeUInt32LE(r.CENSIG,0),n.writeUInt16LE(e,r.CENVEM),n.writeUInt16LE(t,r.CENVER),n.writeUInt16LE(i&~r.FLG_DESC,r.CENFLG),n.writeUInt16LE(a,r.CENHOW),n.writeUInt32LE(o,r.CENTIM),n.writeUInt32LE(s,r.CENCRC),n.writeUInt32LE(c,r.CENSIZ),n.writeUInt32LE(l,r.CENLEN),n.writeUInt16LE(u,r.CENNAM),n.writeUInt16LE(d,r.CENEXT),n.writeUInt16LE(f,r.CENCOM),n.writeUInt16LE(p,r.CENDSK),n.writeUInt16LE(m,r.CENATT),n.writeUInt32LE(h,r.CENATX),n.writeUInt32LE(g,r.CENOFF),n},toJSON:function(){let o=function(e){return e+` bytes`};return{made:e,version:t,flags:i,method:n.methodToString(a),time:this.time,crc:`0x`+s.toString(16).toUpperCase(),compressedSize:o(c),size:o(l),fileNameLength:o(u),extraLength:o(d),commentLength:o(f),diskNumStart:p,inAttr:m,attr:h,offset:g,centralHeaderSize:o(r.CENHDR+u+d+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Th=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=n.Constants;t.exports=function(){var e=0,t=0,i=0,a=0,o=0;let s=()=>e>r.EF_ZIP64_OR_16||t>r.EF_ZIP64_OR_16||i>r.EF_ZIP64_OR_32||a>r.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return i},set size(e){i=e},get offset(){return a},set offset(e){a=e},get commentLength(){return o},set commentLength(e){o=e},get mainHeaderSize(){return(s()?r.ZIP64HDR+r.END64HDR:0)+r.ENDHDR+o},loadFromBinary:function(s){if((s.length!==r.ENDHDR||s.readUInt32LE(0)!==r.ENDSIG)&&(s.length<r.ZIP64HDR||s.readUInt32LE(0)!==r.ZIP64SIG))throw n.Errors.INVALID_END();s.readUInt32LE(0)===r.ENDSIG?(e=s.readUInt16LE(r.ENDSUB),t=s.readUInt16LE(r.ENDTOT),i=s.readUInt32LE(r.ENDSIZ),a=s.readUInt32LE(r.ENDOFF),o=s.readUInt16LE(r.ENDCOM)):(e=n.readBigUInt64LE(s,r.ZIP64SUB),t=n.readBigUInt64LE(s,r.ZIP64TOT),i=n.readBigUInt64LE(s,r.ZIP64SIZB),a=n.readBigUInt64LE(s,r.ZIP64OFF),o=0)},toBinary:function(){if(!s()){var c=Buffer.alloc(r.ENDHDR+o);return c.writeUInt32LE(r.ENDSIG,0),c.writeUInt32LE(0,4),c.writeUInt16LE(e,r.ENDSUB),c.writeUInt16LE(t,r.ENDTOT),c.writeUInt32LE(i,r.ENDSIZ),c.writeUInt32LE(a,r.ENDOFF),c.writeUInt16LE(o,r.ENDCOM),c.fill(` `,r.ENDHDR),c}var c=Buffer.alloc(this.mainHeaderSize);let l=0;c.writeUInt32LE(r.ZIP64SIG,l),n.writeBigUInt64LE(c,r.ZIP64HDR-r.ZIP64LEAD,l+r.ZIP64SIZE),c.writeUInt16LE(45,l+r.ZIP64VEM),c.writeUInt16LE(45,l+r.ZIP64VER),c.writeUInt32LE(0,l+r.ZIP64DSK),c.writeUInt32LE(0,l+r.ZIP64DSKDIR),n.writeBigUInt64LE(c,e,l+r.ZIP64SUB),n.writeBigUInt64LE(c,t,l+r.ZIP64TOT),n.writeBigUInt64LE(c,i,l+r.ZIP64SIZB),n.writeBigUInt64LE(c,a,l+r.ZIP64OFF);let u=a+i;return l+=r.ZIP64HDR,c.writeUInt32LE(r.END64SIG,l),c.writeUInt32LE(0,l+r.END64START),n.writeBigUInt64LE(c,u,l+r.END64OFF),c.writeUInt32LE(1,l+r.END64NUMDISKS),l+=r.END64HDR,c.writeUInt32LE(r.ENDSIG,l),c.writeUInt32LE(0,l+4),c.writeUInt16LE(Math.min(e,r.EF_ZIP64_OR_16),l+r.ENDSUB),c.writeUInt16LE(Math.min(t,r.EF_ZIP64_OR_16),l+r.ENDTOT),c.writeUInt32LE(Math.min(i,r.EF_ZIP64_OR_32),l+r.ENDSIZ),c.writeUInt32LE(Math.min(a,r.EF_ZIP64_OR_32),l+r.ENDOFF),c.writeUInt16LE(o,l+r.ENDCOM),c.fill(` `,l+r.ENDHDR),c},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+` bytes`,offset:function(e,t){let n=e.toString(16).toUpperCase();for(;n.length<t;)n=`0`+n;return`0x`+n}(a,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Eh=/* @__PURE__ */ n((e=>{e.EntryHeader=wh(),e.MainHeader=Th()})),Dh=/* @__PURE__ */ n(((t,n)=>{n.exports=function(t){var n=e(`zlib`),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return n.deflateRawSync(t,r)},deflateAsync:function(e){var i=n.createDeflateRaw(r),a=[],o=0;i.on(`data`,function(e){a.push(e),o+=e.length}),i.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var r=0;r<a.length;r++){var i=a[r];i.copy(t,n),n+=i.length}e&&e(t)}),i.end(t)}}}})),Oh=/* @__PURE__ */ n(((t,n)=>{let r=+(process?.versions?.node??``).split(`.`)[0]||0;n.exports=function(t,n){var i=e(`zlib`);let a=r>=15&&n>0?{maxOutputLength:n}:{};return{inflate:function(){return i.inflateRawSync(t,a)},inflateAsync:function(e){var n=i.createInflateRaw(a),r=[],o=0;n.on(`data`,function(e){r.push(e),o+=e.length}),n.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var i=0;i<r.length;i++){var a=r[i];a.copy(t,n),n+=a.length}e&&e(t)}),n.end(t)}}}})),kh=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=yh(),a=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>a[(e^t)&255]^e>>>8,c=()=>typeof r==`function`?r(Buffer.alloc(12)):c.node();c.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};let l={genSalt:c};function u(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}u.prototype.updateKeys=function(e){let t=this.keys;return t[0]=s(t[0],e),t[1]+=t[0]&255,t[1]=o(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},u.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return o(e,e^1)>>8&255};function d(e){let t=new u(e);return function(e){let n=Buffer.alloc(e.length),r=0;for(let i of e)n[r++]=t.updateKeys(i^t.next());return n}}function f(e){let t=new u(e);return function(e,n,r=0){n||=Buffer.alloc(e.length);for(let i of e){let e=t.next();n[r++]=i^e,t.updateKeys(i)}return n}}function p(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=d(n),a=r(e.slice(0,12)),o=(t.flags&8)==8?t.timeHighByte:t.crc>>>24;if(a[11]!==o)throw i.WRONG_PASSWORD();return r(e.slice(12))}function m(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:e===`node`?l.genSalt=c.node:l.genSalt=c}function h(e,t,n,r=!1){e??=Buffer.alloc(0),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=f(n),a=l.genSalt();a[11]=t.crc>>>24&255,r&&(a[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(a,o),i(e,o,12)}n.exports={decrypt:p,encrypt:h,_salter:m}})),Ah=/* @__PURE__ */ n((e=>{e.Deflater=Dh(),e.Inflater=Oh(),e.ZipCrypto=kh()})),jh=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=Eh(),i=n.Constants,a=Ah();t.exports=function(e,t){var o=new r.EntryHeader,s=Buffer.alloc(0),c=Buffer.alloc(0),l=!1,u=null,d=Buffer.alloc(0),f=Buffer.alloc(0),p=!0;let m=e,h=typeof m.decoder==`object`?m.decoder:n.decoder;p=h.hasOwnProperty(`efs`)?h.efs:!1;function g(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(f=o.loadLocalHeaderFromBinary(t),t.slice(o.realDataOffset,o.realDataOffset+o.compressedSize))}function _(e){let t=o.flags_desc||o.localHeader.flags_desc?o.crc:o.localHeader.crc;return n.crc32(e)===t}function v(e,t,r){if(t===void 0&&typeof e==`string`&&(r=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var i=g();if(i.length===0)return e&&t&&t(i),i;if(o.encrypted){if(typeof r!=`string`&&!Buffer.isBuffer(r))throw n.Errors.INVALID_PASS_PARAM();i=a.ZipCrypto.decrypt(i,o,r)}var c;switch(o.method){case n.Constants.STORED:if(c=Buffer.alloc(i.length),i.copy(c),_(c))return e&&t&&t(c),c;throw e&&t&&t(c,n.Errors.BAD_CRC()),n.Errors.BAD_CRC();case n.Constants.DEFLATED:var u=new a.Inflater(i,o.size);if(e)u.inflateAsync(function(e){t&&(_(e)?t(e):t(e,n.Errors.BAD_CRC()))});else{if(c=u.inflate(),!_(c))throw n.Errors.BAD_CRC(`"${h.decode(s)}"`);return c}break;default:throw e&&t&&t(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD()),n.Errors.UNKNOWN_METHOD()}}function y(e,r){if((!u||!u.length)&&Buffer.isBuffer(t))return e&&r&&r(g()),g();if(u.length&&!l){var i;switch(o.method){case n.Constants.STORED:return o.compressedSize=o.size,i=Buffer.alloc(u.length),u.copy(i),e&&r&&r(i),i;default:case n.Constants.DEFLATED:var s=new a.Deflater(u);if(e)s.deflateAsync(function(e){i=Buffer.alloc(e.length),o.compressedSize=e.length,e.copy(i),r&&r(i)});else{var c=s.deflate();return o.compressedSize=c.length,c}s=null}}else if(e&&r)r(Buffer.alloc(0));else return Buffer.alloc(0)}function b(e,t){return n.readBigUInt64LE(e,t)}function x(e){try{for(var t=0,r,a,o;t+4<e.length;)r=e.readUInt16LE(t),t+=2,a=e.readUInt16LE(t),t+=2,o=e.slice(t,t+a),t+=a,i.ID_ZIP64===r&&S(o)}catch{throw n.Errors.EXTRA_FIELD_PARSE_ERROR()}}function S(e){var t,n,r,a;e.length>=i.EF_ZIP64_SCOMP&&(t=b(e,i.EF_ZIP64_SUNCOMP),o.size===i.EF_ZIP64_OR_32&&(o.size=t)),e.length>=i.EF_ZIP64_RHO&&(n=b(e,i.EF_ZIP64_SCOMP),o.compressedSize===i.EF_ZIP64_OR_32&&(o.compressedSize=n)),e.length>=i.EF_ZIP64_DSN&&(r=b(e,i.EF_ZIP64_RHO),o.offset===i.EF_ZIP64_OR_32&&(o.offset=r)),e.length>=i.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(i.EF_ZIP64_DSN),o.diskNumStart===i.EF_ZIP64_OR_16&&(o.diskNumStart=a))}return{get entryName(){return h.decode(s)},get rawEntryName(){return s},set entryName(e){s=n.toBuffer(e,h.encode);var t=s[s.length-1];l=t===47||t===92,o.fileNameLength=s.length},get efs(){return typeof p==`function`?p(this.entryName):p},get extra(){return d},set extra(e){d=e,o.extraLength=e.length,x(e)},get comment(){return h.decode(c)},set comment(e){if(c=n.toBuffer(e,h.encode),o.commentLength=c.length,c.length>65535)throw n.Errors.COMMENT_TOO_LONG()},get name(){let e=h.decode(s);return l?e.replace(/[/\\]$/,``).split(`/`).pop():e.split(`/`).pop()},get isDirectory(){return l},getCompressedData:function(){return y(!1,null)},getCompressedDataAsync:function(e){y(!0,e)},setData:function(e){u=n.toBuffer(e,n.decoder.encode),!l&&u.length?(o.size=u.length,o.method=n.Constants.DEFLATED,o.crc=n.crc32(e),o.changed=!0):o.method=n.Constants.STORED},getData:function(e){return o.changed?u:v(!1,null,e)},getDataAsync:function(e,t){o.changed?e(u):v(!0,e,t)},set attr(e){o.attr=e},get attr(){return o.attr},set header(e){o.loadFromBinary(e)},get header(){return o},packCentralHeader:function(){o.flags_efs=this.efs,o.extraLength=d.length;var e=o.centralHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,d.copy(e,t),t+=o.extraLength,c.copy(e,t),e},packLocalHeader:function(){let e=0;o.flags_efs=this.efs,o.extraLocalLength=f.length;let t=o.localHeaderToBinary(),n=Buffer.alloc(t.length+s.length+o.extraLocalLength);return t.copy(n,e),e+=t.length,s.copy(n,e),e+=s.length,f.copy(n,e),e+=f.length,n},toJSON:function(){let e=function(e){return`<`+(e&&e.length+` bytes buffer`||`null`)+`>`};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:o.toJSON(),compressedData:e(t),data:e(u)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Mh=/* @__PURE__ */ n(((e,t)=>{let n=jh(),r=Eh(),i=Ch();t.exports=function(e,t){var a=[],o=Object.create(null),s=Buffer.alloc(0),c=new r.MainHeader,l=!1;let u=/* @__PURE__ */ new Set,d=t,{noSort:f,decoder:p}=d;e?g(d.readEntries):l=!0;function m(){let e=/* @__PURE__ */ new Set;for(let t of Object.keys(o)){let n=t.split(`/`);if(n.pop(),n.length)for(let t=0;t<n.length;t++){let r=n.slice(0,t+1).join(`/`)+`/`;e.add(r)}}for(let t of e)if(!(t in o)){let e=new n(d);e.entryName=t,e.attr=16,e.temporary=!0,a.push(e),o[e.entryName]=e,u.add(e)}}function h(){if(l=!0,o=Object.create(null),c.diskEntries>(e.length-c.offset)/i.Constants.CENHDR)throw i.Errors.DISK_ENTRY_TOO_LARGE();a=Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var s=t,f=new n(d,e);f.header=e.slice(s,s+=i.Constants.CENHDR),f.entryName=e.slice(s,s+=f.header.fileNameLength),f.header.extraLength&&(f.extra=e.slice(s,s+=f.header.extraLength)),f.header.commentLength&&(f.comment=e.slice(s,s+f.header.commentLength)),t+=f.header.centralHeaderSize,a[r]=f,o[f.entryName]=f}u.clear(),m()}function g(t){var n=e.length-i.Constants.ENDHDR,r=Math.max(0,n-65535),a=r,o=e.length,l=-1,u=0;for(typeof d.trailingSpace==`boolean`&&d.trailingSpace&&(r=0);n>=a;n--)if(e[n]===80){if(e.readUInt32LE(n)===i.Constants.ENDSIG)l=n,u=n,o=n+i.Constants.ENDHDR,a=n-i.Constants.END64HDR;else if(e.readUInt32LE(n)===i.Constants.END64SIG)a=r;else if(e.readUInt32LE(n)===i.Constants.ZIP64SIG){l=n,o=n+i.readBigUInt64LE(e,n+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}if(l==-1)throw i.Errors.INVALID_FORMAT();c.loadFromBinary(e.slice(l,o)),c.commentLength&&(s=e.slice(u+i.Constants.ENDHDR)),t&&h()}function _(){a.length>1&&!f&&(a=a.map(e=>({entry:e,key:e.entryName.toLowerCase()})).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>e.entry))}return{get entries(){return l||h(),a.filter(e=>!u.has(e))},get comment(){return p.decode(s)},set comment(e){s=i.toBuffer(e,p.encode),c.commentLength=s.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||h(),o[e]||null},setEntry:function(e){l||h(),a.push(e),o[e.entryName]=e,c.totalEntries=a.length},deleteFile:function(e,t=!0){l||h();let n=o[e];this.getEntryChildren(n,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||h();let t=o[e],n=a.indexOf(t);n>=0&&(a.splice(n,1),delete o[e],c.totalEntries=a.length)},getEntryChildren:function(e,t=!0){if(l||h(),typeof e==`object`){if(e.isDirectory&&t){let t=[],n=e.entryName;for(let e of a)e.entryName.startsWith(n)&&t.push(e);return t}return[e]}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||h(),_();let t=[],n=[],r=0,i=0;c.size=0,c.offset=0;let a=0;for(let e of this.entries){let o=e.getCompressedData();e.header.offset=i;let s=e.packLocalHeader(),l=s.length+o.length;i+=l,t.push(s),t.push(o);let u=e.packCentralHeader();n.push(u),c.size+=u.length,r+=l+u.length,a++}r+=c.mainHeaderSize,c.offset=i,c.totalEntries=a,i=0;let o=Buffer.alloc(r);for(let e of t)e.copy(o,i),i+=e.length;for(let e of n)e.copy(o,i),i+=e.length;let u=c.toBinary();return s&&s.copy(u,u.length-s.length),u.copy(o,i),e=o,l=!1,o},toAsyncBuffer:function(t,n,r,i){try{l||h(),_();let n=[],a=[],o=0,u=0,d=0;c.size=0,c.offset=0;let f=function(p){if(p.length>0){let e=p.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){i&&i(t),e.header.offset=u;let s=e.packLocalHeader(),l=s.length+r.length;u+=l,n.push(s),n.push(r);let m=e.packCentralHeader();a.push(m),c.size+=m.length,o+=l+m.length,d++,f(p)})}else{o+=c.mainHeaderSize,c.offset=u,c.totalEntries=d,u=0;let r=Buffer.alloc(o);n.forEach(function(e){e.copy(r,u),u+=e.length}),a.forEach(function(e){e.copy(r,u),u+=e.length});let i=c.toBinary();s&&s.copy(i,i.length-s.length),i.copy(r,u),e=r,l=!1,t(r)}};f(Array.from(this.entries))}catch(e){n(e)}}}}})),Nh=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=Ch(),i=e(`path`),a=jh(),o=Mh(),s=(...e)=>r.findLast(e,e=>typeof e==`boolean`),c=(...e)=>r.findLast(e,e=>typeof e==`string`),l=(...e)=>r.findLast(e,e=>typeof e==`function`),u={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};n.exports=function(e,t){let n=null,d=Object.assign(Object.create(null),u);e&&typeof e==`object`&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),Buffer.isBuffer(e)&&(n=e,d.method=r.Constants.BUFFER,e=void 0)),Object.assign(d,t);let f=new r(d),p=e=>{e.filter(e=>e.attr).sort((e,t)=>t.path.length-e.path.length).forEach(e=>f.fs.chmodSync(e.path,e.attr))};if((typeof d.decoder!=`object`||typeof d.decoder.encode!=`function`||typeof d.decoder.decode!=`function`)&&(d.decoder=r.decoder),e&&typeof e==`string`){if(f.fs.existsSync(e))d.method=r.Constants.FILE,d.filename=e,n=f.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME()}let m=new o(n,d),{canonical:h,sanitize:g,zipnamefix:_}=r;function v(e){if(e&&m){var t;if(typeof e==`string`&&(t=m.getEntry(i.posix.normalize(e))),typeof e==`object`&&e.entryName!==void 0&&e.header!==void 0&&(t=m.getEntry(e.entryName)),t)return t}return null}function y(e){let{join:t,normalize:n,sep:r}=i.posix;return t(i.isAbsolute(e)?`/`:`.`,n(r+e.split(`\\`).join(r)+r))}function b(e){return e instanceof RegExp?(function(e){return function(t){return e.test(t)}})(e):typeof e==`function`?e:()=>!0}let x=(e,t)=>{let n=t.slice(-1);return n=n===f.sep?f.sep:``,i.relative(e,t)+n};return{readFile:function(e,t){var n=v(e);return n&&n.getData(t)||null},childCount:function(e){let t=v(e);if(t)return m.getChildCount(t)},readFileAsync:function(e,t){var n=v(e);n?n.getDataAsync(t):t(null,`getEntry failed for:`+e)},readAsText:function(e,t){var n=v(e);if(n){var r=n.getData();if(r&&r.length)return r.toString(t||`utf8`)}return``},readAsTextAsync:function(e,t,n){var r=v(e);r?r.getDataAsync(function(e,r){r?t(e,r):e&&e.length?t(e.toString(n||`utf8`)):t(``)}):t(``)},deleteFile:function(e,t=!0){var n=v(e);n&&m.deleteFile(n.entryName,t)},deleteEntry:function(e){var t=v(e);t&&m.deleteEntry(t.entryName)},addZipComment:function(e){m.comment=e},getZipComment:function(){return m.comment||``},addZipEntryComment:function(e,t){var n=v(e);n&&(n.comment=t)},getZipEntryComment:function(e){var t=v(e);return t&&t.comment||``},updateFile:function(e,t){var n=v(e);n&&n.setData(t)},addLocalFile:function(e,t,n,a){if(f.fs.existsSync(e)){t=t?y(t):``;let r=i.win32.basename(i.win32.normalize(e));t+=n||r;let o=f.fs.statSync(e),s=o.isFile()?f.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=f.sep),this.addFile(t,s,a,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e=typeof e==`object`?e:{localPath:e};let n=i.resolve(e.localPath),{comment:r}=e,{zipPath:a,zipName:o}=e,s=this;f.fs.stat(n,function(e,c){if(e)return t(e,!1);a=a?y(a):``;let l=i.win32.basename(i.win32.normalize(n));if(a+=o||l,c.isFile())f.fs.readFile(n,function(e,n){return e?t(e,!1):(s.addFile(a,n,r,c),setImmediate(t,void 0,!0))});else if(c.isDirectory())return a+=f.sep,s.addFile(a,Buffer.alloc(0),r,c),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,n){if(n=b(n),t=t?y(t):``,e=i.normalize(e),f.fs.existsSync(e)){let r=f.findFiles(e),a=this;if(r.length)for(let o of r){let r=i.join(t,x(e,o));n(r)&&a.addLocalFile(o,i.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,n,a){a=b(a),n=n?y(n):``,e=i.normalize(e);var o=this;f.fs.open(e,`r`,function(i){if(i&&i.code===`ENOENT`)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(i)t(void 0,i);else{var s=f.findFiles(e),c=-1,l=function(){if(c+=1,c<s.length){var r=s[c],i=x(e,r).split(`\\`).join(`/`);i=i.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``),a(i)?f.fs.stat(r,function(e,a){e&&t(void 0,e),a.isFile()?f.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(n+i,r,``,a),l())}):(o.addFile(n+i+`/`,Buffer.alloc(0),``,a),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let n=this;e=typeof e==`object`?e:{localPath:e};let a=i.resolve(y(e.localPath)),{zipPath:o,filter:s,namefix:c}=e;s instanceof RegExp?s=(function(e){return function(t){return e.test(t)}})(s):typeof s!=`function`&&(s=function(){return!0}),o=o?y(o):``,c===`latin1`&&(c=e=>e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``)),typeof c!=`function`&&(c=e=>e);let l=e=>i.join(o,c(x(a,e))),u=e=>i.win32.basename(i.win32.normalize(c(e)));f.fs.open(a,`r`,function(e){e&&e.code===`ENOENT`?t(void 0,r.Errors.FILE_NOT_FOUND(a)):e?t(void 0,e):f.findFilesAsync(a,function(e,r){if(e)return t(e);r=r.filter(e=>s(l(e))),r.length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,a){if(r||a===!1)return setImmediate(e,r,!1);n.addLocalFileAsync({localPath:t,zipPath:i.dirname(l(t)),zipName:u(t)},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((n,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&n(this)})})},addFile:function(e,t,n,r){e=_(e);let i=v(e),o=i!=null;o||(i=new a(d),i.entryName=e),i.comment=n||``;let s=typeof r==`object`&&r instanceof f.fs.Stats;s&&(i.header.time=r.mtime);var c=i.isDirectory?16:0;let l=i.isDirectory?16384:32768;return l|=s?4095&r.mode:typeof r==`number`?4095&r:i.isDirectory?493:420,c=(c|l<<16)>>>0,i.attr=c,i.setData(t),o||m.setEntry(i),i},getEntries:function(e){return m.password=e,m?m.entries:[]},getEntry:function(e){return v(e)},getEntryCount:function(){return m.getEntryCount()},forEach:function(e){return m.forEach(e)},extractEntryTo:function(e,t,n,a,o,l){a=s(!1,a),o=s(!1,o),n=s(!0,n),l=c(o,l);var u=v(e);if(!u)throw r.Errors.NO_ENTRY();var d=h(u.entryName),p=g(t,l&&!u.isDirectory?h(l):n?d:i.basename(d));if(u.isDirectory)return m.getEntryChildren(u).forEach(function(e){if(e.isDirectory)return;var i=e.getData();if(!i)throw r.Errors.CANT_EXTRACT_FILE();var s=h(n?e.entryName:e.entryName.substring(u.entryName.length)),c=g(t,s);let l=o?e.header.fileAttr:void 0;f.writeFileTo(c,i,a,l)}),!0;var _=u.getData(m.password);if(!_)throw r.Errors.CANT_EXTRACT_FILE();if(f.fs.existsSync(p)&&!a)throw r.Errors.CANT_OVERRIDE();let y=o?e.header.fileAttr:void 0;return f.writeFileTo(p,_,a,y),!0},test:function(e){if(!m)return!1;for(var t of m.entries)try{if(t.isDirectory)continue;if(!t.getData(e))return!1}catch{return!1}return!0},extractAllTo:function(e,t,n,i){if(n=s(!1,n),i=c(n,i),t=s(!1,t),!m)throw r.Errors.NO_ZIP();let a=[];m.entries.forEach(function(o){var s=g(e,h(o.entryName));if(o.isDirectory){f.makeDir(s),n&&a.push({path:s,attr:o.header.fileAttr});return}var c=o.getData(i);if(!c)throw r.Errors.CANT_EXTRACT_FILE();let l=n?o.header.fileAttr:void 0;f.writeFileTo(s,c,t,l);try{f.fs.utimesSync(s,o.header.time,o.header.time)}catch{}}),p(a)},extractAllToAsync:function(e,t,n,a){if(a=l(t,n,a),n=s(!1,n),t=s(!1,t),!a)return new Promise((r,i)=>{this.extractAllToAsync(e,t,n,function(e){e?i(e):r(this)})});if(!m){a(r.Errors.NO_ZIP());return}e=i.resolve(e);let o=t=>g(e,i.normalize(h(t.entryName))),c=(e,t)=>/* @__PURE__ */ Error(e+`: "`+t+`"`),u=[],d=[];m.entries.forEach(e=>{e.isDirectory?u.push(e):d.push(e)});let _=[];for(let e of u){let t=o(e),r=n?e.header.fileAttr:void 0;try{f.makeDir(t)}catch{a(c(`Unable to create folder`,t));continue}r&&_.push({path:t,attr:r});try{f.fs.utimesSync(t,e.header.time,e.header.time)}catch{}}d.reverse().reduce(function(a,o){return function(s){if(s)a(s);else{let s=i.normalize(h(o.entryName)),l=g(e,s);o.getDataAsync(function(e,i){if(i)a(i);else if(!e)a(r.Errors.CANT_EXTRACT_FILE());else{let r=n?o.header.fileAttr:void 0;f.writeFileToAsync(l,e,t,r,function(e){if(!e)return a(c(`Unable to write file`,l));f.fs.utimes(l,o.header.time,o.header.time,function(){a()})})}})}}},e=>{if(!e)try{p(_)}catch(e){return a(c(`Unable to set folder permissions`,e.path||``))}a(e)})()},writeZip:function(e,t){if(arguments.length===1&&typeof e==`function`&&(t=e,e=``),!e&&d.filename&&(e=d.filename),e){var n=m.compressToBuffer();if(n){var r=f.writeFileTo(e,n,!0);typeof t==`function`&&t(r?null:/* @__PURE__ */ Error(`failed`),``)}}},writeZipPromise:function(e,t){let{overwrite:n,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,i)=>{!e&&d.filename&&(e=d.filename),e||i(`ADM-ZIP: ZIP File Name Missing`),this.toBufferPromise().then(a=>{f.writeFileToAsync(e,a,n,r,e=>e?t(e):i(`ADM-ZIP: Wasn't able to write zip file`))},i)})},toBufferPromise:function(){return new Promise((e,t)=>{m.toAsyncBuffer(e,t)})},toBuffer:function(e,t,n,r){return typeof e==`function`?(m.toAsyncBuffer(e,t,n,r),null):m.compressToBuffer()}}}})))(),1),Ph=/* @__PURE__ */ t(St(),1),Fh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Ih=`mintlify`,Lh=`templates`,Rh=`main`;function zh(){return Fh(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${Ih}/${Lh}/contents/?ref=${Rh}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function Bh(e){return Fh(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${Ih}/${Lh}/contents/${encodeURIComponent(e)}?ref=${Rh}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield zh().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${Ih}/${Lh}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function Vh(){return Fh(this,void 0,void 0,function*(){D((0,P.jsx)(f,{message:`fetching available templates...`}));let e;try{e=yield zh()}catch{throw a(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(a(),e.length===0)throw Error(`No templates are currently available.`);return Yd({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Hh(e,t,n,r){return Fh(this,void 0,void 0,function*(){let i=kn.join(e,`__template__.zip`),o=kn.join(e,`__template_extract__`);try{D((0,P.jsx)(f,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${Ih}/${Lh}/archive/refs/heads/${Rh}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield Ph.default.writeFile(i,Buffer.from(t))}finally{a()}D((0,P.jsx)(f,{message:`extracting template...`}));try{new Nh.default(i).extractAllTo(o,!0)}finally{a()}let n=kn.join(o,`${Lh}-${Rh}`),r=kn.join(n,t);if(!(yield Ph.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield Ph.default.copy(r,e,{overwrite:!0})}finally{yield Ph.default.remove(i).catch(()=>{}),yield Ph.default.remove(o).catch(()=>{})}let s=kn.join(e,`docs.json`);if(yield Ph.default.pathExists(s)){let e=yield Ph.default.readJson(s);n&&(e.name=n),r&&(e.theme=r),yield Ph.default.writeJson(s,e,{spaces:2})}})}var Uh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Wh=e=>{h((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(ke,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Je()&&D((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Gh=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;h((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<system-message>`}),(0,P.jsx)(M,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,P.jsx)(M,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
555
+ `)}var oh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const sh=[`bug`,`docs`,`idea`];function ch(e){return oh(this,void 0,void 0,function*(){let t;try{t=yield fetch(`${rt}/api/cli/feedback`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify(Object.assign(Object.assign({},e),{source:`cli`}))})}catch{return`could not reach the server`}return t.ok?void 0:`could not send feedback (HTTP ${t.status})`})}function lh(e){return oh(this,void 0,void 0,function*(){let t=yield ch(e);return D(t?(0,P.jsx)(c,{message:t}):(0,P.jsx)(o,{message:`feedback sent`})),!t})}var uh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})},dh=function(e){return this instanceof dh?(this.v=e,this):new dh(e)},fh=function(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof __values==`function`?__values(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}},ph=function(e){var t={},n;return r(`next`),r(`throw`,function(e){throw e}),r(`return`),t[Symbol.iterator]=function(){return this},t;function r(r,i){t[r]=e[r]?function(t){return(n=!n)?{value:dh(e[r](t)),done:!1}:i?i(t):t}:i}},mh=function(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof dh?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}};function hh(){return uh(this,void 0,void 0,function*(){try{let e=yield Hn.readFile(In.join(et,`.gitignore`),`utf-8`);return le(e)}catch{return[]}})}function gh(e,t){return mh(this,arguments,function*(){let n=yield dh(Hn.readdir(e,{withFileTypes:!0}));for(let r of n){let n=In.join(e,r.name),i=In.relative(et,n).split(In.sep).join(`/`);De(i,t,r.isDirectory())||(r.isDirectory()?yield dh(yield*ph(fh(gh(n,t)))):r.name.endsWith(`.mdx`)&&(yield yield dh(n)))}})}const _h=()=>uh(void 0,void 0,void 0,function*(){var e,t,n,r;let{mdxToPm:i,pmToMdx:a,canonicalPmToMdxOptions:s}=yield import(`./converter-DovGGlMI.js`),l=[...yield hh(),...yield ge(et)],u=ce(l),d=0,f=0,p=0;try{for(var m=!0,h=fh(gh(et,u)),g;g=yield h.next(),e=g.done,!e;m=!0){r=g.value,m=!1;let e=r;d++;let t=In.relative(et,e);try{let t=yield Hn.readFile(e,`utf-8`),n=t,r=0;for(let e=0;e<3;e++){let{doc:t,frontmatter:o}=i(n);e===0&&(r=Object.keys(o).length);let c=`${a(t,Object.assign({frontmatter:o},s))}\n`;if(c===n)break;n=c}if(r>0&&!n.startsWith(`---`))throw Error(`formatting would remove frontmatter; file left untouched`);n!==t&&(yield Hn.writeFile(e,n),f++)}catch(e){p++,D((0,P.jsx)(c,{message:`${t}: ${e instanceof Error?e.message:`unknown error`}`}))}}}catch(e){t={error:e}}finally{try{!m&&!e&&(n=h.return)&&(yield n.call(h))}finally{if(t)throw t.error}}D((0,P.jsx)(o,{message:`formatted ${f} of ${d} mdx file${d===1?``:`s`}${p>0?` (${p} failed)`:``}`})),yield N(+(p>0))});var vh=/* @__PURE__ */ n(((e,t)=>{t.exports={LOCHDR:30,LOCSIG:67324752,LOCVER:4,LOCFLG:6,LOCHOW:8,LOCTIM:10,LOCCRC:14,LOCSIZ:18,LOCLEN:22,LOCNAM:26,LOCEXT:28,EXTSIG:134695760,EXTHDR:16,EXTCRC:4,EXTSIZ:8,EXTLEN:12,CENHDR:46,CENSIG:33639248,CENVEM:4,CENVER:6,CENFLG:8,CENHOW:10,CENTIM:12,CENCRC:16,CENSIZ:20,CENLEN:24,CENNAM:28,CENEXT:30,CENCOM:32,CENDSK:34,CENATT:36,CENATX:38,CENOFF:42,ENDHDR:22,ENDSIG:101010256,ENDSUB:8,ENDTOT:10,ENDSIZ:12,ENDOFF:16,ENDCOM:20,END64HDR:20,END64SIG:117853008,END64START:4,END64OFF:8,END64NUMDISKS:16,ZIP64SIG:101075792,ZIP64HDR:56,ZIP64LEAD:12,ZIP64SIZE:4,ZIP64VEM:12,ZIP64VER:14,ZIP64DSK:16,ZIP64DSKDIR:20,ZIP64SUB:24,ZIP64TOT:32,ZIP64SIZB:40,ZIP64OFF:48,ZIP64EXTRA:56,STORED:0,SHRUNK:1,REDUCED1:2,REDUCED2:3,REDUCED3:4,REDUCED4:5,IMPLODED:6,DEFLATED:8,ENHANCED_DEFLATED:9,PKWARE:10,BZIP2:12,LZMA:14,IBM_TERSE:18,IBM_LZ77:19,AES_ENCRYPT:99,FLG_ENC:1,FLG_COMP1:2,FLG_COMP2:4,FLG_DESC:8,FLG_ENH:16,FLG_PATCH:32,FLG_STR:64,FLG_EFS:2048,FLG_MSK:4096,FILE:2,BUFFER:1,NONE:0,EF_ID:0,EF_SIZE:2,ID_ZIP64:1,ID_AVINFO:7,ID_PFS:8,ID_OS2:9,ID_NTFS:10,ID_OPENVMS:12,ID_UNIX:13,ID_FORK:14,ID_PATCH:15,ID_X509_PKCS7:20,ID_X509_CERTID_F:21,ID_X509_CERTID_C:22,ID_STRONGENC:23,ID_RECORD_MGT:24,ID_X509_PKCS7_RL:25,ID_IBM1:101,ID_IBM2:102,ID_POSZIP:18064,EF_ZIP64_OR_32:4294967295,EF_ZIP64_OR_16:65535,EF_ZIP64_SUNCOMP:0,EF_ZIP64_SCOMP:8,EF_ZIP64_RHO:16,EF_ZIP64_DSN:24}})),yh=/* @__PURE__ */ n((e=>{let t={INVALID_LOC:`Invalid LOC header (bad signature)`,INVALID_CEN:`Invalid CEN header (bad signature)`,INVALID_END:`Invalid END header (bad signature)`,DESCRIPTOR_NOT_EXIST:`No descriptor present`,DESCRIPTOR_UNKNOWN:`Unknown descriptor format`,DESCRIPTOR_FAULTY:`Descriptor data is malformed`,NO_DATA:`Nothing to decompress`,BAD_CRC:`CRC32 checksum failed {0}`,FILE_IN_THE_WAY:`There is a file in the way: {0}`,UNKNOWN_METHOD:`Invalid/unsupported compression method`,AVAIL_DATA:`inflate::Available inflate data did not terminate`,INVALID_DISTANCE:`inflate::Invalid literal/length or distance code in fixed or dynamic block`,TO_MANY_CODES:`inflate::Dynamic block code description: too many length or distance codes`,INVALID_REPEAT_LEN:`inflate::Dynamic block code description: repeat more than specified lengths`,INVALID_REPEAT_FIRST:`inflate::Dynamic block code description: repeat lengths with no first length`,INCOMPLETE_CODES:`inflate::Dynamic block code description: code lengths codes incomplete`,INVALID_DYN_DISTANCE:`inflate::Dynamic block code description: invalid distance code lengths`,INVALID_CODES_LEN:`inflate::Dynamic block code description: invalid literal/length code lengths`,INVALID_STORE_BLOCK:`inflate::Stored block length did not match one's complement`,INVALID_BLOCK_TYPE:`inflate::Invalid block type (type == 3)`,CANT_EXTRACT_FILE:`Could not extract the file`,CANT_OVERRIDE:`Target file already exists`,DISK_ENTRY_TOO_LARGE:`Number of disk entries is too large`,NO_ZIP:`No zip file was loaded`,NO_ENTRY:`Entry doesn't exist`,DIRECTORY_CONTENT_ERROR:`A directory cannot have content`,FILE_NOT_FOUND:`File not found: "{0}"`,NOT_IMPLEMENTED:`Not implemented`,INVALID_FILENAME:`Invalid filename`,INVALID_FORMAT:`Invalid or unsupported zip format. No END header found`,INVALID_PASS_PARAM:`Incompatible password parameter`,WRONG_PASSWORD:`Wrong Password`,COMMENT_TOO_LONG:`Comment is too long`,EXTRA_FIELD_PARSE_ERROR:`Extra field parsing error`};function n(e){return function(...t){return t.length&&(e=e.replace(/\{(\d)\}/g,(e,n)=>t[n]||``)),/* @__PURE__ */ Error(`ADM-ZIP: `+e)}}for(let r of Object.keys(t))e[r]=n(t[r])})),bh=/* @__PURE__ */ n(((t,n)=>{let r=e(`fs`),i=e(`path`),a=vh(),o=yh(),s=typeof process==`object`&&process.platform===`win32`,c=e=>typeof e==`object`&&!!e,l=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=3988292384^t>>>1:t>>>=1;return t>>>0});function u(e){this.sep=i.sep,this.fs=r,c(e)&&c(e.fs)&&typeof e.fs.statSync==`function`&&(this.fs=e.fs)}n.exports=u,u.prototype.makeDir=function(e){let t=this;function n(e){let n=e.split(t.sep)[0];e.split(t.sep).forEach(function(e){if(e&&e.substr(-1,1)!==`:`){n+=t.sep+e;var r;try{r=t.fs.statSync(n)}catch(e){if(e.message&&e.message.startsWith(`ENOENT`))t.fs.mkdirSync(n);else throw e}if(r&&r.isFile())throw o.FILE_IN_THE_WAY(`"${n}"`)}})}n(e)},u.prototype.writeFileTo=function(e,t,n,r){let a=this;if(a.fs.existsSync(e)&&(!n||a.fs.statSync(e).isDirectory()))return!1;var o=i.dirname(e);a.fs.existsSync(o)||a.makeDir(o);var s;try{s=a.fs.openSync(e,`w`,438)}catch{a.fs.chmodSync(e,438),s=a.fs.openSync(e,`w`,438)}if(s)try{a.fs.writeSync(s,t,0,t.length,0)}finally{a.fs.closeSync(s)}return a.fs.chmodSync(e,r||438),!0},u.prototype.writeFileToAsync=function(e,t,n,r,a){typeof r==`function`&&(a=r,r=void 0);let o=this;o.fs.exists(e,function(s){if(s&&!n)return a(!1);o.fs.stat(e,function(n,c){if(s&&c&&c.isDirectory())return a(!1);var l=i.dirname(e);o.fs.exists(l,function(n){if(!n)try{o.makeDir(l)}catch{return a(!1)}let i=function(n){o.fs.write(n,t,0,t.length,0,function(t){o.fs.close(n,function(){if(t)return a(!1);o.fs.chmod(e,r||438,function(){a(!0)})})})};o.fs.open(e,`w`,438,function(t,n){t?o.fs.chmod(e,438,function(){o.fs.open(e,`w`,438,function(e,t){if(e||!t)return a(!1);i(t)})}):n?i(n):a(!1)})})})})},u.prototype.findFiles=function(e){let t=this;function n(e,r,a,o){typeof r==`boolean`&&(a=r,r=void 0);let s=[];return t.fs.readdirSync(e).forEach(function(c){let l=i.join(e,c),u=t.fs.statSync(l);if((!r||r.test(l))&&s.push(i.normalize(l)+(u.isDirectory()?t.sep:``)),u.isDirectory()&&a){let e=t.fs.realpathSync(l);o.has(e)||(o.add(e),s=s.concat(n(l,r,a,o)))}}),s}return n(e,void 0,!0,/* @__PURE__ */ new Set([t.fs.realpathSync(e)]))},u.prototype.findFilesAsync=function(e,t){let n=this,r=[],a=!1,o=function(e){a||(a=!0,t(e,e?void 0:r))},s=function(e,t,a){n.fs.readdir(e,function(o,c){if(o)return a(o);let l=c.length;if(!l)return a();c.forEach(function(o){let c=i.join(e,o);n.fs.stat(c,function(e,o){if(e)return a(e);o?(r.push(i.normalize(c)+(o.isDirectory()?n.sep:``)),o.isDirectory()?n.fs.realpath(c,function(e,n){if(e)return a(e);t.has(n)?--l||a():(t.add(n),s(c,t,function(e){if(e)return a(e);--l||a()}))}):--l||a()):--l||a()})})})};n.fs.realpath(e,function(t,n){if(t)return o(t);s(e,/* @__PURE__ */ new Set([n]),o)})},u.prototype.getAttributes=function(){},u.prototype.setAttributes=function(){},u.crc32update=function(e,t){return l[(e^t)&255]^e>>>8},u.crc32=function(e){typeof e==`string`&&(e=Buffer.from(e,`utf8`));let t=e.length,n=-1;for(let r=0;r<t;)n=u.crc32update(n,e[r++]);return~n>>>0},u.methodToString=function(e){switch(e){case a.STORED:return`STORED (`+e+`)`;case a.DEFLATED:return`DEFLATED (`+e+`)`;default:return`UNSUPPORTED (`+e+`)`}},u.canonical=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.join(`.`,t)},u.zipnamefix=function(e){if(!e)return``;let t=i.posix.normalize(`/`+e.split(`\\`).join(`/`));return i.posix.join(`.`,t)},u.findLast=function(e,t){if(!Array.isArray(e))throw TypeError(`arr is not array`);let n=e.length>>>0;for(let r=n-1;r>=0;r--)if(t(e[r],r,e))return e[r]},u.sanitize=function(e,t){e=i.resolve(i.normalize(e));for(var n=t.split(`/`),r=0,a=n.length;r<a;r++){var o=i.normalize(i.join(e,n.slice(r,a).join(i.sep)));if(o===e||o.startsWith(e+i.sep))return o}return i.normalize(i.join(e,i.basename(t)))},u.toBuffer=function(e,t){return Buffer.isBuffer(e)?e:e instanceof Uint8Array?Buffer.from(e):typeof e==`string`?t(e):Buffer.alloc(0)},u.readBigUInt64LE=function(e,t){let n=e.readUInt32LE(t);return e.readUInt32LE(t+4)*4294967296+n},u.writeBigUInt64LE=function(e,t,n){let r=t>>>0,i=Math.floor(t/4294967296)>>>0;e.writeUInt32LE(r,n),e.writeUInt32LE(i,n+4)},u.fromDOS2Date=function(e){return new Date((e>>25&127)+1980,Math.max((e>>21&15)-1,0),Math.max(e>>16&31,1),e>>11&31,e>>5&63,(e&31)<<1)},u.fromDate2DOS=function(e){let t=0,n=0;return e.getFullYear()>1979&&(t=(e.getFullYear()-1980&127)<<9|e.getMonth()+1<<5|e.getDate(),n=e.getHours()<<11|e.getMinutes()<<5|e.getSeconds()>>1),t<<16|n},u.isWin=s,u.crcTable=l})),xh=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports=function(e,{fs:t}){var n=e||``,i=o(),a=null;function o(){return{directory:!1,readonly:!1,hidden:!1,executable:!1,mtime:0,atime:0}}return n&&t.existsSync(n)?(a=t.statSync(n),i.directory=a.isDirectory(),i.mtime=a.mtime,i.atime=a.atime,i.executable=!!(73&a.mode),i.readonly=!(128&a.mode),i.hidden=r.basename(n)[0]===`.`):console.warn(`Invalid path: `+n),{get directory(){return i.directory},get readOnly(){return i.readonly},get hidden(){return i.hidden},get mtime(){return i.mtime},get atime(){return i.atime},get executable(){return i.executable},decodeAttributes:function(){},encodeAttributes:function(){},toJSON:function(){return{path:n,isDirectory:i.directory,isReadOnly:i.readonly,isHidden:i.hidden,isExecutable:i.executable,mTime:i.mtime,aTime:i.atime}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Sh=/* @__PURE__ */ n(((e,t)=>{t.exports={efs:!0,encode:e=>Buffer.from(e,`utf8`),decode:e=>e.toString(`utf8`)}})),Ch=/* @__PURE__ */ n(((e,t)=>{t.exports=bh(),t.exports.Constants=vh(),t.exports.Errors=yh(),t.exports.FileAttr=xh(),t.exports.decoder=Sh()})),wh=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=n.Constants;t.exports=function(){var e=20,t=10,i=0,a=0,o=0,s=0,c=0,l=0,u=0,d=0,f=0,p=0,m=0,h=0,g=0;e|=n.isWin?2560:768,i|=r.FLG_EFS;let _={extraLen:0},v=e=>Math.max(0,e)>>>0,y=e=>Math.max(0,e)&255;return o=n.fromDate2DOS(/* @__PURE__ */ new Date),{get made(){return e},set made(t){e=t},get version(){return t},set version(e){t=e},get flags(){return i},set flags(e){i=e},get flags_efs(){return(i&r.FLG_EFS)>0},set flags_efs(e){e?i|=r.FLG_EFS:i&=~r.FLG_EFS},get flags_desc(){return(i&r.FLG_DESC)>0},set flags_desc(e){e?i|=r.FLG_DESC:i&=~r.FLG_DESC},get method(){return a},set method(e){switch(e){case r.STORED:this.version=10;break;case r.DEFLATED:default:this.version=20}a=e},get time(){return n.fromDOS2Date(this.timeval)},set time(e){e=new Date(e),this.timeval=n.fromDate2DOS(e)},get timeval(){return o},set timeval(e){o=v(e)},get timeHighByte(){return y(o>>>8)},get crc(){return s},set crc(e){s=v(e)},get compressedSize(){return c},set compressedSize(e){c=v(e)},get size(){return l},set size(e){l=v(e)},get fileNameLength(){return u},set fileNameLength(e){u=e},get extraLength(){return d},set extraLength(e){d=e},get extraLocalLength(){return _.extraLen},set extraLocalLength(e){_.extraLen=e},get commentLength(){return f},set commentLength(e){f=e},get diskNumStart(){return p},set diskNumStart(e){p=v(e)},get inAttr(){return m},set inAttr(e){m=v(e)},get attr(){return h},set attr(e){h=v(e)},get fileAttr(){return(h||0)>>16&4095},get offset(){return g},set offset(e){g=v(e)},get encrypted(){return(i&r.FLG_ENC)===r.FLG_ENC},get centralHeaderSize(){return r.CENHDR+u+d+f},get realDataOffset(){return g+r.LOCHDR+_.fnameLen+_.extraLen},get localHeader(){return _},loadLocalHeaderFromBinary:function(e){var t=e.slice(g,g+r.LOCHDR);if(t.readUInt32LE(0)!==r.LOCSIG)throw n.Errors.INVALID_LOC();_.version=t.readUInt16LE(r.LOCVER),_.flags=t.readUInt16LE(r.LOCFLG),_.flags_desc=(_.flags&r.FLG_DESC)>0,_.method=t.readUInt16LE(r.LOCHOW),_.time=t.readUInt32LE(r.LOCTIM),_.crc=t.readUInt32LE(r.LOCCRC),_.compressedSize=t.readUInt32LE(r.LOCSIZ),_.size=t.readUInt32LE(r.LOCLEN),_.fnameLen=t.readUInt16LE(r.LOCNAM),_.extraLen=t.readUInt16LE(r.LOCEXT);let i=g+r.LOCHDR+_.fnameLen,a=i+_.extraLen;return e.slice(i,a)},loadFromBinary:function(_){if(_.length!==r.CENHDR||_.readUInt32LE(0)!==r.CENSIG)throw n.Errors.INVALID_CEN();e=_.readUInt16LE(r.CENVEM),t=_.readUInt16LE(r.CENVER),i=_.readUInt16LE(r.CENFLG),a=_.readUInt16LE(r.CENHOW),o=_.readUInt32LE(r.CENTIM),s=_.readUInt32LE(r.CENCRC),c=_.readUInt32LE(r.CENSIZ),l=_.readUInt32LE(r.CENLEN),u=_.readUInt16LE(r.CENNAM),d=_.readUInt16LE(r.CENEXT),f=_.readUInt16LE(r.CENCOM),p=_.readUInt16LE(r.CENDSK),m=_.readUInt16LE(r.CENATT),h=_.readUInt32LE(r.CENATX),g=_.readUInt32LE(r.CENOFF)},localHeaderToBinary:function(){var e=Buffer.alloc(r.LOCHDR);return e.writeUInt32LE(r.LOCSIG,0),e.writeUInt16LE(t,r.LOCVER),e.writeUInt16LE(i&~r.FLG_DESC,r.LOCFLG),e.writeUInt16LE(a,r.LOCHOW),e.writeUInt32LE(o,r.LOCTIM),e.writeUInt32LE(s,r.LOCCRC),e.writeUInt32LE(c,r.LOCSIZ),e.writeUInt32LE(l,r.LOCLEN),e.writeUInt16LE(u,r.LOCNAM),e.writeUInt16LE(_.extraLen,r.LOCEXT),e},centralHeaderToBinary:function(){var n=Buffer.alloc(r.CENHDR+u+d+f);return n.writeUInt32LE(r.CENSIG,0),n.writeUInt16LE(e,r.CENVEM),n.writeUInt16LE(t,r.CENVER),n.writeUInt16LE(i&~r.FLG_DESC,r.CENFLG),n.writeUInt16LE(a,r.CENHOW),n.writeUInt32LE(o,r.CENTIM),n.writeUInt32LE(s,r.CENCRC),n.writeUInt32LE(c,r.CENSIZ),n.writeUInt32LE(l,r.CENLEN),n.writeUInt16LE(u,r.CENNAM),n.writeUInt16LE(d,r.CENEXT),n.writeUInt16LE(f,r.CENCOM),n.writeUInt16LE(p,r.CENDSK),n.writeUInt16LE(m,r.CENATT),n.writeUInt32LE(h,r.CENATX),n.writeUInt32LE(g,r.CENOFF),n},toJSON:function(){let o=function(e){return e+` bytes`};return{made:e,version:t,flags:i,method:n.methodToString(a),time:this.time,crc:`0x`+s.toString(16).toUpperCase(),compressedSize:o(c),size:o(l),fileNameLength:o(u),extraLength:o(d),commentLength:o(f),diskNumStart:p,inAttr:m,attr:h,offset:g,centralHeaderSize:o(r.CENHDR+u+d+f)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Th=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=n.Constants;t.exports=function(){var e=0,t=0,i=0,a=0,o=0;let s=()=>e>r.EF_ZIP64_OR_16||t>r.EF_ZIP64_OR_16||i>r.EF_ZIP64_OR_32||a>r.EF_ZIP64_OR_32;return{get diskEntries(){return e},set diskEntries(n){e=t=n},get totalEntries(){return t},set totalEntries(n){t=e=n},get size(){return i},set size(e){i=e},get offset(){return a},set offset(e){a=e},get commentLength(){return o},set commentLength(e){o=e},get mainHeaderSize(){return(s()?r.ZIP64HDR+r.END64HDR:0)+r.ENDHDR+o},loadFromBinary:function(s){if((s.length!==r.ENDHDR||s.readUInt32LE(0)!==r.ENDSIG)&&(s.length<r.ZIP64HDR||s.readUInt32LE(0)!==r.ZIP64SIG))throw n.Errors.INVALID_END();s.readUInt32LE(0)===r.ENDSIG?(e=s.readUInt16LE(r.ENDSUB),t=s.readUInt16LE(r.ENDTOT),i=s.readUInt32LE(r.ENDSIZ),a=s.readUInt32LE(r.ENDOFF),o=s.readUInt16LE(r.ENDCOM)):(e=n.readBigUInt64LE(s,r.ZIP64SUB),t=n.readBigUInt64LE(s,r.ZIP64TOT),i=n.readBigUInt64LE(s,r.ZIP64SIZB),a=n.readBigUInt64LE(s,r.ZIP64OFF),o=0)},toBinary:function(){if(!s()){var c=Buffer.alloc(r.ENDHDR+o);return c.writeUInt32LE(r.ENDSIG,0),c.writeUInt32LE(0,4),c.writeUInt16LE(e,r.ENDSUB),c.writeUInt16LE(t,r.ENDTOT),c.writeUInt32LE(i,r.ENDSIZ),c.writeUInt32LE(a,r.ENDOFF),c.writeUInt16LE(o,r.ENDCOM),c.fill(` `,r.ENDHDR),c}var c=Buffer.alloc(this.mainHeaderSize);let l=0;c.writeUInt32LE(r.ZIP64SIG,l),n.writeBigUInt64LE(c,r.ZIP64HDR-r.ZIP64LEAD,l+r.ZIP64SIZE),c.writeUInt16LE(45,l+r.ZIP64VEM),c.writeUInt16LE(45,l+r.ZIP64VER),c.writeUInt32LE(0,l+r.ZIP64DSK),c.writeUInt32LE(0,l+r.ZIP64DSKDIR),n.writeBigUInt64LE(c,e,l+r.ZIP64SUB),n.writeBigUInt64LE(c,t,l+r.ZIP64TOT),n.writeBigUInt64LE(c,i,l+r.ZIP64SIZB),n.writeBigUInt64LE(c,a,l+r.ZIP64OFF);let u=a+i;return l+=r.ZIP64HDR,c.writeUInt32LE(r.END64SIG,l),c.writeUInt32LE(0,l+r.END64START),n.writeBigUInt64LE(c,u,l+r.END64OFF),c.writeUInt32LE(1,l+r.END64NUMDISKS),l+=r.END64HDR,c.writeUInt32LE(r.ENDSIG,l),c.writeUInt32LE(0,l+4),c.writeUInt16LE(Math.min(e,r.EF_ZIP64_OR_16),l+r.ENDSUB),c.writeUInt16LE(Math.min(t,r.EF_ZIP64_OR_16),l+r.ENDTOT),c.writeUInt32LE(Math.min(i,r.EF_ZIP64_OR_32),l+r.ENDSIZ),c.writeUInt32LE(Math.min(a,r.EF_ZIP64_OR_32),l+r.ENDOFF),c.writeUInt16LE(o,l+r.ENDCOM),c.fill(` `,l+r.ENDHDR),c},toJSON:function(){return{diskEntries:e,totalEntries:t,size:i+` bytes`,offset:function(e,t){let n=e.toString(16).toUpperCase();for(;n.length<t;)n=`0`+n;return`0x`+n}(a,4),commentLength:o}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Eh=/* @__PURE__ */ n((e=>{e.EntryHeader=wh(),e.MainHeader=Th()})),Dh=/* @__PURE__ */ n(((t,n)=>{n.exports=function(t){var n=e(`zlib`),r={chunkSize:(parseInt(t.length/1024)+1)*1024};return{deflate:function(){return n.deflateRawSync(t,r)},deflateAsync:function(e){var i=n.createDeflateRaw(r),a=[],o=0;i.on(`data`,function(e){a.push(e),o+=e.length}),i.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var r=0;r<a.length;r++){var i=a[r];i.copy(t,n),n+=i.length}e&&e(t)}),i.end(t)}}}})),Oh=/* @__PURE__ */ n(((t,n)=>{let r=+(process?.versions?.node??``).split(`.`)[0]||0;n.exports=function(t,n){var i=e(`zlib`);let a=r>=15&&n>0?{maxOutputLength:n}:{};return{inflate:function(){return i.inflateRawSync(t,a)},inflateAsync:function(e){var n=i.createInflateRaw(a),r=[],o=0;n.on(`data`,function(e){r.push(e),o+=e.length}),n.on(`end`,function(){var t=Buffer.alloc(o),n=0;t.fill(0);for(var i=0;i<r.length;i++){var a=r[i];a.copy(t,n),n+=a.length}e&&e(t)}),n.end(t)}}}})),kh=/* @__PURE__ */ n(((t,n)=>{let{randomFillSync:r}=e(`crypto`),i=yh(),a=(/* @__PURE__ */ new Uint32Array(256)).map((e,t)=>{for(let e=0;e<8;e++)t&1?t=t>>>1^3988292384:t>>>=1;return t>>>0}),o=(e,t)=>Math.imul(e,t)>>>0,s=(e,t)=>a[(e^t)&255]^e>>>8,c=()=>typeof r==`function`?r(Buffer.alloc(12)):c.node();c.node=()=>{let e=Buffer.alloc(12),t=e.length;for(let n=0;n<t;n++)e[n]=Math.random()*256&255;return e};let l={genSalt:c};function u(e){let t=Buffer.isBuffer(e)?e:Buffer.from(e);this.keys=new Uint32Array([305419896,591751049,878082192]);for(let e=0;e<t.length;e++)this.updateKeys(t[e])}u.prototype.updateKeys=function(e){let t=this.keys;return t[0]=s(t[0],e),t[1]+=t[0]&255,t[1]=o(t[1],134775813)+1,t[2]=s(t[2],t[1]>>>24),e},u.prototype.next=function(){let e=(this.keys[2]|2)>>>0;return o(e,e^1)>>8&255};function d(e){let t=new u(e);return function(e){let n=Buffer.alloc(e.length),r=0;for(let i of e)n[r++]=t.updateKeys(i^t.next());return n}}function f(e){let t=new u(e);return function(e,n,r=0){n||=Buffer.alloc(e.length);for(let i of e){let e=t.next();n[r++]=i^e,t.updateKeys(i)}return n}}function p(e,t,n){if(!e||!Buffer.isBuffer(e)||e.length<12)return Buffer.alloc(0);let r=d(n),a=r(e.slice(0,12)),o=(t.flags&8)==8?t.timeHighByte:t.crc>>>24;if(a[11]!==o)throw i.WRONG_PASSWORD();return r(e.slice(12))}function m(e){Buffer.isBuffer(e)&&e.length>=12?l.genSalt=function(){return e.slice(0,12)}:e===`node`?l.genSalt=c.node:l.genSalt=c}function h(e,t,n,r=!1){e??=Buffer.alloc(0),Buffer.isBuffer(e)||(e=Buffer.from(e.toString()));let i=f(n),a=l.genSalt();a[11]=t.crc>>>24&255,r&&(a[10]=t.crc>>>16&255);let o=Buffer.alloc(e.length+12);return i(a,o),i(e,o,12)}n.exports={decrypt:p,encrypt:h,_salter:m}})),Ah=/* @__PURE__ */ n((e=>{e.Deflater=Dh(),e.Inflater=Oh(),e.ZipCrypto=kh()})),jh=/* @__PURE__ */ n(((e,t)=>{var n=Ch(),r=Eh(),i=n.Constants,a=Ah();t.exports=function(e,t){var o=new r.EntryHeader,s=Buffer.alloc(0),c=Buffer.alloc(0),l=!1,u=null,d=Buffer.alloc(0),f=Buffer.alloc(0),p=!0;let m=e,h=typeof m.decoder==`object`?m.decoder:n.decoder;p=h.hasOwnProperty(`efs`)?h.efs:!1;function g(){return!t||!(t instanceof Uint8Array)?Buffer.alloc(0):(f=o.loadLocalHeaderFromBinary(t),t.slice(o.realDataOffset,o.realDataOffset+o.compressedSize))}function _(e){let t=o.flags_desc||o.localHeader.flags_desc?o.crc:o.localHeader.crc;return n.crc32(e)===t}function v(e,t,r){if(t===void 0&&typeof e==`string`&&(r=e,e=void 0),l)return e&&t&&t(Buffer.alloc(0),n.Errors.DIRECTORY_CONTENT_ERROR()),Buffer.alloc(0);var i=g();if(i.length===0)return e&&t&&t(i),i;if(o.encrypted){if(typeof r!=`string`&&!Buffer.isBuffer(r))throw n.Errors.INVALID_PASS_PARAM();i=a.ZipCrypto.decrypt(i,o,r)}var c;switch(o.method){case n.Constants.STORED:if(c=Buffer.alloc(i.length),i.copy(c),_(c))return e&&t&&t(c),c;throw e&&t&&t(c,n.Errors.BAD_CRC()),n.Errors.BAD_CRC();case n.Constants.DEFLATED:var u=new a.Inflater(i,o.size);if(e)u.inflateAsync(function(e){t&&(_(e)?t(e):t(e,n.Errors.BAD_CRC()))});else{if(c=u.inflate(),!_(c))throw n.Errors.BAD_CRC(`"${h.decode(s)}"`);return c}break;default:throw e&&t&&t(Buffer.alloc(0),n.Errors.UNKNOWN_METHOD()),n.Errors.UNKNOWN_METHOD()}}function y(e,r){if((!u||!u.length)&&Buffer.isBuffer(t))return e&&r&&r(g()),g();if(u.length&&!l){var i;switch(o.method){case n.Constants.STORED:return o.compressedSize=o.size,i=Buffer.alloc(u.length),u.copy(i),e&&r&&r(i),i;default:case n.Constants.DEFLATED:var s=new a.Deflater(u);if(e)s.deflateAsync(function(e){i=Buffer.alloc(e.length),o.compressedSize=e.length,e.copy(i),r&&r(i)});else{var c=s.deflate();return o.compressedSize=c.length,c}s=null}}else if(e&&r)r(Buffer.alloc(0));else return Buffer.alloc(0)}function b(e,t){return n.readBigUInt64LE(e,t)}function x(e){try{for(var t=0,r,a,o;t+4<e.length;)r=e.readUInt16LE(t),t+=2,a=e.readUInt16LE(t),t+=2,o=e.slice(t,t+a),t+=a,i.ID_ZIP64===r&&S(o)}catch{throw n.Errors.EXTRA_FIELD_PARSE_ERROR()}}function S(e){var t,n,r,a;e.length>=i.EF_ZIP64_SCOMP&&(t=b(e,i.EF_ZIP64_SUNCOMP),o.size===i.EF_ZIP64_OR_32&&(o.size=t)),e.length>=i.EF_ZIP64_RHO&&(n=b(e,i.EF_ZIP64_SCOMP),o.compressedSize===i.EF_ZIP64_OR_32&&(o.compressedSize=n)),e.length>=i.EF_ZIP64_DSN&&(r=b(e,i.EF_ZIP64_RHO),o.offset===i.EF_ZIP64_OR_32&&(o.offset=r)),e.length>=i.EF_ZIP64_DSN+4&&(a=e.readUInt32LE(i.EF_ZIP64_DSN),o.diskNumStart===i.EF_ZIP64_OR_16&&(o.diskNumStart=a))}return{get entryName(){return h.decode(s)},get rawEntryName(){return s},set entryName(e){s=n.toBuffer(e,h.encode);var t=s[s.length-1];l=t===47||t===92,o.fileNameLength=s.length},get efs(){return typeof p==`function`?p(this.entryName):p},get extra(){return d},set extra(e){d=e,o.extraLength=e.length,x(e)},get comment(){return h.decode(c)},set comment(e){if(c=n.toBuffer(e,h.encode),o.commentLength=c.length,c.length>65535)throw n.Errors.COMMENT_TOO_LONG()},get name(){let e=h.decode(s);return l?e.replace(/[/\\]$/,``).split(`/`).pop():e.split(`/`).pop()},get isDirectory(){return l},getCompressedData:function(){return y(!1,null)},getCompressedDataAsync:function(e){y(!0,e)},setData:function(e){u=n.toBuffer(e,n.decoder.encode),!l&&u.length?(o.size=u.length,o.method=n.Constants.DEFLATED,o.crc=n.crc32(e),o.changed=!0):o.method=n.Constants.STORED},getData:function(e){return o.changed?u:v(!1,null,e)},getDataAsync:function(e,t){o.changed?e(u):v(!0,e,t)},set attr(e){o.attr=e},get attr(){return o.attr},set header(e){o.loadFromBinary(e)},get header(){return o},packCentralHeader:function(){o.flags_efs=this.efs,o.extraLength=d.length;var e=o.centralHeaderToBinary(),t=n.Constants.CENHDR;return s.copy(e,t),t+=s.length,d.copy(e,t),t+=o.extraLength,c.copy(e,t),e},packLocalHeader:function(){let e=0;o.flags_efs=this.efs,o.extraLocalLength=f.length;let t=o.localHeaderToBinary(),n=Buffer.alloc(t.length+s.length+o.extraLocalLength);return t.copy(n,e),e+=t.length,s.copy(n,e),e+=s.length,f.copy(n,e),e+=f.length,n},toJSON:function(){let e=function(e){return`<`+(e&&e.length+` bytes buffer`||`null`)+`>`};return{entryName:this.entryName,name:this.name,comment:this.comment,isDirectory:this.isDirectory,header:o.toJSON(),compressedData:e(t),data:e(u)}},toString:function(){return JSON.stringify(this.toJSON(),null,` `)}}}})),Mh=/* @__PURE__ */ n(((e,t)=>{let n=jh(),r=Eh(),i=Ch();t.exports=function(e,t){var a=[],o=Object.create(null),s=Buffer.alloc(0),c=new r.MainHeader,l=!1;let u=/* @__PURE__ */ new Set,d=t,{noSort:f,decoder:p}=d;e?g(d.readEntries):l=!0;function m(){let e=/* @__PURE__ */ new Set;for(let t of Object.keys(o)){let n=t.split(`/`);if(n.pop(),n.length)for(let t=0;t<n.length;t++){let r=n.slice(0,t+1).join(`/`)+`/`;e.add(r)}}for(let t of e)if(!(t in o)){let e=new n(d);e.entryName=t,e.attr=16,e.temporary=!0,a.push(e),o[e.entryName]=e,u.add(e)}}function h(){if(l=!0,o=Object.create(null),c.diskEntries>(e.length-c.offset)/i.Constants.CENHDR)throw i.Errors.DISK_ENTRY_TOO_LARGE();a=Array(c.diskEntries);for(var t=c.offset,r=0;r<a.length;r++){var s=t,f=new n(d,e);f.header=e.slice(s,s+=i.Constants.CENHDR),f.entryName=e.slice(s,s+=f.header.fileNameLength),f.header.extraLength&&(f.extra=e.slice(s,s+=f.header.extraLength)),f.header.commentLength&&(f.comment=e.slice(s,s+f.header.commentLength)),t+=f.header.centralHeaderSize,a[r]=f,o[f.entryName]=f}u.clear(),m()}function g(t){var n=e.length-i.Constants.ENDHDR,r=Math.max(0,n-65535),a=r,o=e.length,l=-1,u=0;for(typeof d.trailingSpace==`boolean`&&d.trailingSpace&&(r=0);n>=a;n--)if(e[n]===80){if(e.readUInt32LE(n)===i.Constants.ENDSIG)l=n,u=n,o=n+i.Constants.ENDHDR,a=n-i.Constants.END64HDR;else if(e.readUInt32LE(n)===i.Constants.END64SIG)a=r;else if(e.readUInt32LE(n)===i.Constants.ZIP64SIG){l=n,o=n+i.readBigUInt64LE(e,n+i.Constants.ZIP64SIZE)+i.Constants.ZIP64LEAD;break}}if(l==-1)throw i.Errors.INVALID_FORMAT();c.loadFromBinary(e.slice(l,o)),c.commentLength&&(s=e.slice(u+i.Constants.ENDHDR)),t&&h()}function _(){a.length>1&&!f&&(a=a.map(e=>({entry:e,key:e.entryName.toLowerCase()})).sort((e,t)=>e.key.localeCompare(t.key)).map(e=>e.entry))}return{get entries(){return l||h(),a.filter(e=>!u.has(e))},get comment(){return p.decode(s)},set comment(e){s=i.toBuffer(e,p.encode),c.commentLength=s.length},getEntryCount:function(){return l?a.length:c.diskEntries},forEach:function(e){this.entries.forEach(e)},getEntry:function(e){return l||h(),o[e]||null},setEntry:function(e){l||h(),a.push(e),o[e.entryName]=e,c.totalEntries=a.length},deleteFile:function(e,t=!0){l||h();let n=o[e];this.getEntryChildren(n,t).map(e=>e.entryName).forEach(this.deleteEntry)},deleteEntry:function(e){l||h();let t=o[e],n=a.indexOf(t);n>=0&&(a.splice(n,1),delete o[e],c.totalEntries=a.length)},getEntryChildren:function(e,t=!0){if(l||h(),typeof e==`object`){if(e.isDirectory&&t){let t=[],n=e.entryName;for(let e of a)e.entryName.startsWith(n)&&t.push(e);return t}return[e]}return[]},getChildCount:function(e){if(e&&e.isDirectory){let t=this.getEntryChildren(e);return t.includes(e)?t.length-1:t.length}return 0},compressToBuffer:function(){l||h(),_();let t=[],n=[],r=0,i=0;c.size=0,c.offset=0;let a=0;for(let e of this.entries){let o=e.getCompressedData();e.header.offset=i;let s=e.packLocalHeader(),l=s.length+o.length;i+=l,t.push(s),t.push(o);let u=e.packCentralHeader();n.push(u),c.size+=u.length,r+=l+u.length,a++}r+=c.mainHeaderSize,c.offset=i,c.totalEntries=a,i=0;let o=Buffer.alloc(r);for(let e of t)e.copy(o,i),i+=e.length;for(let e of n)e.copy(o,i),i+=e.length;let u=c.toBinary();return s&&s.copy(u,u.length-s.length),u.copy(o,i),e=o,l=!1,o},toAsyncBuffer:function(t,n,r,i){try{l||h(),_();let n=[],a=[],o=0,u=0,d=0;c.size=0,c.offset=0;let f=function(p){if(p.length>0){let e=p.shift(),t=e.entryName+e.extra.toString();r&&r(t),e.getCompressedDataAsync(function(r){i&&i(t),e.header.offset=u;let s=e.packLocalHeader(),l=s.length+r.length;u+=l,n.push(s),n.push(r);let m=e.packCentralHeader();a.push(m),c.size+=m.length,o+=l+m.length,d++,f(p)})}else{o+=c.mainHeaderSize,c.offset=u,c.totalEntries=d,u=0;let r=Buffer.alloc(o);n.forEach(function(e){e.copy(r,u),u+=e.length}),a.forEach(function(e){e.copy(r,u),u+=e.length});let i=c.toBinary();s&&s.copy(i,i.length-s.length),i.copy(r,u),e=r,l=!1,t(r)}};f(Array.from(this.entries))}catch(e){n(e)}}}}})),Nh=/* @__PURE__ */ t((/* @__PURE__ */ n(((t,n)=>{let r=Ch(),i=e(`path`),a=jh(),o=Mh(),s=(...e)=>r.findLast(e,e=>typeof e==`boolean`),c=(...e)=>r.findLast(e,e=>typeof e==`string`),l=(...e)=>r.findLast(e,e=>typeof e==`function`),u={noSort:!1,readEntries:!1,method:r.Constants.NONE,fs:null};n.exports=function(e,t){let n=null,d=Object.assign(Object.create(null),u);e&&typeof e==`object`&&(e instanceof Uint8Array||(Object.assign(d,e),e=d.input?d.input:void 0,d.input&&delete d.input),Buffer.isBuffer(e)&&(n=e,d.method=r.Constants.BUFFER,e=void 0)),Object.assign(d,t);let f=new r(d),p=e=>{e.filter(e=>e.attr).sort((e,t)=>t.path.length-e.path.length).forEach(e=>f.fs.chmodSync(e.path,e.attr))};if((typeof d.decoder!=`object`||typeof d.decoder.encode!=`function`||typeof d.decoder.decode!=`function`)&&(d.decoder=r.decoder),e&&typeof e==`string`){if(f.fs.existsSync(e))d.method=r.Constants.FILE,d.filename=e,n=f.fs.readFileSync(e);else throw r.Errors.INVALID_FILENAME()}let m=new o(n,d),{canonical:h,sanitize:g,zipnamefix:_}=r;function v(e){if(e&&m){var t;if(typeof e==`string`&&(t=m.getEntry(i.posix.normalize(e))),typeof e==`object`&&e.entryName!==void 0&&e.header!==void 0&&(t=m.getEntry(e.entryName)),t)return t}return null}function y(e){let{join:t,normalize:n,sep:r}=i.posix;return t(i.isAbsolute(e)?`/`:`.`,n(r+e.split(`\\`).join(r)+r))}function b(e){return e instanceof RegExp?(function(e){return function(t){return e.test(t)}})(e):typeof e==`function`?e:()=>!0}let x=(e,t)=>{let n=t.slice(-1);return n=n===f.sep?f.sep:``,i.relative(e,t)+n};return{readFile:function(e,t){var n=v(e);return n&&n.getData(t)||null},childCount:function(e){let t=v(e);if(t)return m.getChildCount(t)},readFileAsync:function(e,t){var n=v(e);n?n.getDataAsync(t):t(null,`getEntry failed for:`+e)},readAsText:function(e,t){var n=v(e);if(n){var r=n.getData();if(r&&r.length)return r.toString(t||`utf8`)}return``},readAsTextAsync:function(e,t,n){var r=v(e);r?r.getDataAsync(function(e,r){r?t(e,r):e&&e.length?t(e.toString(n||`utf8`)):t(``)}):t(``)},deleteFile:function(e,t=!0){var n=v(e);n&&m.deleteFile(n.entryName,t)},deleteEntry:function(e){var t=v(e);t&&m.deleteEntry(t.entryName)},addZipComment:function(e){m.comment=e},getZipComment:function(){return m.comment||``},addZipEntryComment:function(e,t){var n=v(e);n&&(n.comment=t)},getZipEntryComment:function(e){var t=v(e);return t&&t.comment||``},updateFile:function(e,t){var n=v(e);n&&n.setData(t)},addLocalFile:function(e,t,n,a){if(f.fs.existsSync(e)){t=t?y(t):``;let r=i.win32.basename(i.win32.normalize(e));t+=n||r;let o=f.fs.statSync(e),s=o.isFile()?f.fs.readFileSync(e):Buffer.alloc(0);o.isDirectory()&&(t+=f.sep),this.addFile(t,s,a,o)}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFileAsync:function(e,t){e=typeof e==`object`?e:{localPath:e};let n=i.resolve(e.localPath),{comment:r}=e,{zipPath:a,zipName:o}=e,s=this;f.fs.stat(n,function(e,c){if(e)return t(e,!1);a=a?y(a):``;let l=i.win32.basename(i.win32.normalize(n));if(a+=o||l,c.isFile())f.fs.readFile(n,function(e,n){return e?t(e,!1):(s.addFile(a,n,r,c),setImmediate(t,void 0,!0))});else if(c.isDirectory())return a+=f.sep,s.addFile(a,Buffer.alloc(0),r,c),setImmediate(t,void 0,!0)})},addLocalFolder:function(e,t,n){if(n=b(n),t=t?y(t):``,e=i.normalize(e),f.fs.existsSync(e)){let r=f.findFiles(e),a=this;if(r.length)for(let o of r){let r=i.join(t,x(e,o));n(r)&&a.addLocalFile(o,i.dirname(r))}}else throw r.Errors.FILE_NOT_FOUND(e)},addLocalFolderAsync:function(e,t,n,a){a=b(a),n=n?y(n):``,e=i.normalize(e);var o=this;f.fs.open(e,`r`,function(i){if(i&&i.code===`ENOENT`)t(void 0,r.Errors.FILE_NOT_FOUND(e));else if(i)t(void 0,i);else{var s=f.findFiles(e),c=-1,l=function(){if(c+=1,c<s.length){var r=s[c],i=x(e,r).split(`\\`).join(`/`);i=i.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``),a(i)?f.fs.stat(r,function(e,a){e&&t(void 0,e),a.isFile()?f.fs.readFile(r,function(e,r){e?t(void 0,e):(o.addFile(n+i,r,``,a),l())}):(o.addFile(n+i+`/`,Buffer.alloc(0),``,a),l())}):process.nextTick(()=>{l()})}else t(!0,void 0)};l()}})},addLocalFolderAsync2:function(e,t){let n=this;e=typeof e==`object`?e:{localPath:e};let a=i.resolve(y(e.localPath)),{zipPath:o,filter:s,namefix:c}=e;s instanceof RegExp?s=(function(e){return function(t){return e.test(t)}})(s):typeof s!=`function`&&(s=function(){return!0}),o=o?y(o):``,c===`latin1`&&(c=e=>e.normalize(`NFD`).replace(/[\u0300-\u036f]/g,``).replace(/[^\x20-\x7E]/g,``)),typeof c!=`function`&&(c=e=>e);let l=e=>i.join(o,c(x(a,e))),u=e=>i.win32.basename(i.win32.normalize(c(e)));f.fs.open(a,`r`,function(e){e&&e.code===`ENOENT`?t(void 0,r.Errors.FILE_NOT_FOUND(a)):e?t(void 0,e):f.findFilesAsync(a,function(e,r){if(e)return t(e);r=r.filter(e=>s(l(e))),r.length||t(void 0,!1),setImmediate(r.reverse().reduce(function(e,t){return function(r,a){if(r||a===!1)return setImmediate(e,r,!1);n.addLocalFileAsync({localPath:t,zipPath:i.dirname(l(t)),zipName:u(t)},e)}},t))})})},addLocalFolderPromise:function(e,t){return new Promise((n,r)=>{this.addLocalFolderAsync2(Object.assign({localPath:e},t),(e,t)=>{e&&r(e),t&&n(this)})})},addFile:function(e,t,n,r){e=_(e);let i=v(e),o=i!=null;o||(i=new a(d),i.entryName=e),i.comment=n||``;let s=typeof r==`object`&&r instanceof f.fs.Stats;s&&(i.header.time=r.mtime);var c=i.isDirectory?16:0;let l=i.isDirectory?16384:32768;return l|=s?4095&r.mode:typeof r==`number`?4095&r:i.isDirectory?493:420,c=(c|l<<16)>>>0,i.attr=c,i.setData(t),o||m.setEntry(i),i},getEntries:function(e){return m.password=e,m?m.entries:[]},getEntry:function(e){return v(e)},getEntryCount:function(){return m.getEntryCount()},forEach:function(e){return m.forEach(e)},extractEntryTo:function(e,t,n,a,o,l){a=s(!1,a),o=s(!1,o),n=s(!0,n),l=c(o,l);var u=v(e);if(!u)throw r.Errors.NO_ENTRY();var d=h(u.entryName),p=g(t,l&&!u.isDirectory?h(l):n?d:i.basename(d));if(u.isDirectory)return m.getEntryChildren(u).forEach(function(e){if(e.isDirectory)return;var i=e.getData();if(!i)throw r.Errors.CANT_EXTRACT_FILE();var s=h(n?e.entryName:e.entryName.substring(u.entryName.length)),c=g(t,s);let l=o?e.header.fileAttr:void 0;f.writeFileTo(c,i,a,l)}),!0;var _=u.getData(m.password);if(!_)throw r.Errors.CANT_EXTRACT_FILE();if(f.fs.existsSync(p)&&!a)throw r.Errors.CANT_OVERRIDE();let y=o?e.header.fileAttr:void 0;return f.writeFileTo(p,_,a,y),!0},test:function(e){if(!m)return!1;for(var t of m.entries)try{if(t.isDirectory)continue;if(!t.getData(e))return!1}catch{return!1}return!0},extractAllTo:function(e,t,n,i){if(n=s(!1,n),i=c(n,i),t=s(!1,t),!m)throw r.Errors.NO_ZIP();let a=[];m.entries.forEach(function(o){var s=g(e,h(o.entryName));if(o.isDirectory){f.makeDir(s),n&&a.push({path:s,attr:o.header.fileAttr});return}var c=o.getData(i);if(!c)throw r.Errors.CANT_EXTRACT_FILE();let l=n?o.header.fileAttr:void 0;f.writeFileTo(s,c,t,l);try{f.fs.utimesSync(s,o.header.time,o.header.time)}catch{}}),p(a)},extractAllToAsync:function(e,t,n,a){if(a=l(t,n,a),n=s(!1,n),t=s(!1,t),!a)return new Promise((r,i)=>{this.extractAllToAsync(e,t,n,function(e){e?i(e):r(this)})});if(!m){a(r.Errors.NO_ZIP());return}e=i.resolve(e);let o=t=>g(e,i.normalize(h(t.entryName))),c=(e,t)=>/* @__PURE__ */ Error(e+`: "`+t+`"`),u=[],d=[];m.entries.forEach(e=>{e.isDirectory?u.push(e):d.push(e)});let _=[];for(let e of u){let t=o(e),r=n?e.header.fileAttr:void 0;try{f.makeDir(t)}catch{a(c(`Unable to create folder`,t));continue}r&&_.push({path:t,attr:r});try{f.fs.utimesSync(t,e.header.time,e.header.time)}catch{}}d.reverse().reduce(function(a,o){return function(s){if(s)a(s);else{let s=i.normalize(h(o.entryName)),l=g(e,s);o.getDataAsync(function(e,i){if(i)a(i);else if(!e)a(r.Errors.CANT_EXTRACT_FILE());else{let r=n?o.header.fileAttr:void 0;f.writeFileToAsync(l,e,t,r,function(e){if(!e)return a(c(`Unable to write file`,l));f.fs.utimes(l,o.header.time,o.header.time,function(){a()})})}})}}},e=>{if(!e)try{p(_)}catch(e){return a(c(`Unable to set folder permissions`,e.path||``))}a(e)})()},writeZip:function(e,t){if(arguments.length===1&&typeof e==`function`&&(t=e,e=``),!e&&d.filename&&(e=d.filename),e){var n=m.compressToBuffer();if(n){var r=f.writeFileTo(e,n,!0);typeof t==`function`&&t(r?null:/* @__PURE__ */ Error(`failed`),``)}}},writeZipPromise:function(e,t){let{overwrite:n,perm:r}=Object.assign({overwrite:!0},t);return new Promise((t,i)=>{!e&&d.filename&&(e=d.filename),e||i(`ADM-ZIP: ZIP File Name Missing`),this.toBufferPromise().then(a=>{f.writeFileToAsync(e,a,n,r,e=>e?t(e):i(`ADM-ZIP: Wasn't able to write zip file`))},i)})},toBufferPromise:function(){return new Promise((e,t)=>{m.toAsyncBuffer(e,t)})},toBuffer:function(e,t,n,r){return typeof e==`function`?(m.toAsyncBuffer(e,t,n,r),null):m.compressToBuffer()}}}})))(),1),Ph=/* @__PURE__ */ t(St(),1),Fh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Ih=`mintlify`,Lh=`templates`,Rh=`main`;function zh(){return Fh(this,void 0,void 0,function*(){let e=yield fetch(`https://api.github.com/repos/${Ih}/${Lh}/contents/?ref=${Rh}`,{headers:{Accept:`application/vnd.github.v3+json`}});if(!e.ok)throw Error(`Failed to fetch templates: ${e.status} ${e.statusText}`);return(yield e.json()).filter(e=>e.type===`dir`).map(e=>e.name)})}function Bh(e){return Fh(this,void 0,void 0,function*(){if(!e||e===`.`||e===`..`||e.includes(`/`))throw Error(`Invalid template name: "${e}".`);let t=`https://api.github.com/repos/${Ih}/${Lh}/contents/${encodeURIComponent(e)}?ref=${Rh}`,n=yield fetch(t,{headers:{Accept:`application/vnd.github.v3+json`}});if(!n.ok){let t=yield zh().catch(()=>[]),n=t.length>0?` Available templates: ${t.join(`, `)}`:``;throw Error(`Template "${e}" not found in ${Ih}/${Lh}.${n}`)}if(!(yield n.json()).some(e=>e.name===`docs.json`))throw Error(`Template "${e}" is not a valid Mintlify template (missing docs.json).`);return e})}function Vh(){return Fh(this,void 0,void 0,function*(){D((0,P.jsx)(f,{message:`fetching available templates...`}));let e;try{e=yield zh()}catch{throw a(),Error(`Failed to fetch templates. Please check your network connection and try again.`)}if(a(),e.length===0)throw Error(`No templates are currently available.`);return Yd({message:`Choose a template`,choices:e.map(e=>({name:e,value:e}))})})}function Hh(e,t,n,r){return Fh(this,void 0,void 0,function*(){let i=kn.join(e,`__template__.zip`),o=kn.join(e,`__template_extract__`);try{D((0,P.jsx)(f,{message:`downloading template "${t}"...`}));try{let e=yield fetch(`https://github.com/${Ih}/${Lh}/archive/refs/heads/${Rh}.zip`);if(!e.ok)throw Error(`Failed to download templates archive: ${e.status}`);let t=yield e.arrayBuffer();yield Ph.default.writeFile(i,Buffer.from(t))}finally{a()}D((0,P.jsx)(f,{message:`extracting template...`}));try{new Nh.default(i).extractAllTo(o,!0)}finally{a()}let n=kn.join(o,`${Lh}-${Rh}`),r=kn.join(n,t);if(!(yield Ph.default.pathExists(r)))throw Error(`Template directory "${t}" not found in the downloaded archive.`);yield Ph.default.copy(r,e,{overwrite:!0})}finally{yield Ph.default.remove(i).catch(()=>{}),yield Ph.default.remove(o).catch(()=>{})}let s=kn.join(e,`docs.json`);if(yield Ph.default.pathExists(s)){let e=yield Ph.default.readJson(s);n&&(e.name=n),r&&(e.theme=r),yield Ph.default.writeJson(s,e,{spaces:2})}})}var Uh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const Wh=e=>{h((0,P.jsx)(M,{bold:!0,children:`Documentation Setup!`}),(0,P.jsx)(M,{children:`To see your docs run`}),(0,P.jsxs)(ke,{children:[(0,P.jsx)(M,{color:`blue`,children:`cd`}),(0,P.jsxs)(M,{children:[` `,e]})]}),(0,P.jsx)(M,{color:`blue`,children:`mint dev`})),Je()&&D((0,P.jsxs)(M,{children:["When the docs are ready, run `mint validate` in ",e,` to check the build and get publish steps.`]}))},Gh=(e,t,n,r)=>{let i=r===void 0?`Unable to fetch templates — use --template flag if you know the name`:r.length>0?`Templates: ${JSON.stringify(r)}`:`No templates are currently available`;h((0,P.jsx)(M,{children:`Agent Detected - sending AI friendly prompt`}),(0,P.jsx)(M,{children:`<system-message>`}),(0,P.jsx)(M,{children:"Help the user set up a Mintlify docs site with `mint new`. Ask each step one at a time unless the user asks you to skip questions or use your best judgment."}),(0,P.jsx)(M,{children:[`- [ ] Pick a theme or clone a template? (${i})`,`- [ ] If template: which one? If theme: which one? (Themes: ${JSON.stringify(n)})`,`- [ ] Project name?`,`- [ ] Directory? (default: "${e}", auto-created if needed)${t?` ⚠️ "${e}" is occupied — subdirectory, overwrite (--force), or different path?`:``}`].join(`
556
556
  `)}),(0,P.jsx)(M,{children:"Command: `mint new [dir] --theme [theme] --name [name]` or `mint new [dir] --template [template] --name [name]`. --theme optionally overrides a template default. --force overwrites non-empty dirs. Use AskQuestion to present choices."}),(0,P.jsx)(M,{children:`</system-message>`}))};function Kh(e,t,n){return Uh(this,void 0,void 0,function*(){let r=yield zh().catch(()=>void 0);Gh(e,t,n,r)})}function qh(e,t,n){return Uh(this,void 0,void 0,function*(){if(!n)return e;if(Je())return t?e:void 0;let r=yield Yd({message:`Directory ${e} is not empty. What would you like to do?`,choices:[{name:`Create in a subdirectory`,value:`subdir`},{name:`Overwrite current directory (may lose contents)`,value:`overwrite`},{name:`Cancel`,value:`cancel`}]});if(r!==`cancel`){if(r===`subdir`){let t=yield It({message:`Subdirectory name:`,default:`docs`});if(!t||t.trim()===``)throw Error(`Subdirectory name cannot be empty`);let n=e===`.`?t:`${e}/${t}`;return pe(n,process.cwd()),n}return e}})}function Jh(e,t){return Uh(this,void 0,void 0,function*(){return t||It({message:`Project Name`,default:e===`.`?`Mintlify`:e})})}function Yh(){return Uh(this,void 0,void 0,function*(){if((yield Yd({message:`How would you like to set up your docs?`,choices:[{name:`Pick a theme`,value:`theme`},{name:`Clone a template`,value:`template`}]}))===`template`)return Vh()})}function Xh(e,t,n,r,i){return Uh(this,void 0,void 0,function*(){pe(e);let a=he.options.map(e=>e.shape.theme._def.value),o=(yield Ph.default.readdir(e).catch(()=>[])).length>0;if(Je()&&(!r||!i&&!n)||Je()&&o&&!t){yield Kh(e,o,a);return}let s=i?yield Bh(i).then(()=>i):!Je()&&!n?yield Yh():void 0;if(s){let i=yield qh(e,t,o);if(i===void 0){Je()&&(yield Kh(e,o,a));return}let c=yield Jh(i,r);yield Ph.default.ensureDir(i),yield Hh(i,s,c,n),Wh(i);return}let c=yield qh(e,t,o);if(c===void 0){Je()&&(yield Kh(e,o,a));return}let l=r,u=n;Je()||u&&l||(l=yield Jh(c,l),u||=yield Yd({message:`Theme`,choices:a.map(e=>({name:e,value:e}))})),l===void 0||u===void 0?yield Kh(c,o,a):(yield Ph.default.ensureDir(c),yield Zh(c,l,u),Wh(c))})}const Zh=(e,t,n)=>Uh(void 0,void 0,void 0,function*(){D((0,P.jsx)(f,{message:`downloading starter template...`}));let r=yield(yield fetch(`https://github.com/mintlify/starter/archive/refs/heads/main.zip`)).arrayBuffer();yield Ph.default.writeFile(e+`/starter.zip`,Buffer.from(r)),a(),D((0,P.jsx)(f,{message:`extracting...`})),new Nh.default(e+`/starter.zip`).extractAllTo(e,!0),a(),yield Ph.default.copy(e+`/starter-main`,e,{overwrite:!0,filter:e=>!e.includes(`starter-main/starter-main`)}),yield Ph.default.remove(e+`/starter.zip`),yield Ph.default.remove(e+`/starter-main`);let i=e+`/docs.json`,o=yield Ph.default.readJson(i);o.theme=n,o.name=t,yield Ph.default.writeJson(i,o,{spaces:2})});var Qh=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const $h=[{name:`overview`,when:`Start here: how Mintlify works and facts agents most often get wrong`},{name:`new-site`,when:`New docs site, first publish, no account, claim a site, login, no docs.json yet`},{name:`write`,when:`Before creating a page or writing more than a sentence or two; changelogs`},{name:`write components`,when:`Adding or changing components: callouts, cards, steps, tabs, accordions, fields`},{name:`configure`,when:`Changing docs.json: theme, colors, logo, favicon, required fields`},{name:`configure navigation`,when:`Changing navigation: groups, tabs, anchors, dropdowns, products, versions, languages`},{name:`configure settings`,when:`navbar, footer, banner, SEO, search, integrations, contextual menu, redirects, 404`},{name:`configure customization`,when:`Themes, fonts, CSS, JavaScript, or React snippets`},{name:`api-docs`,when:`API documentation: OpenAPI, AsyncAPI, GraphQL, playground`},{name:`api-docs sdk`,when:`SDK reference pages, x-codeSamples, oneOf/anyOf, multiple responses, hiding endpoints`},{name:`publish`,when:`Deploying, "is it live", previews, rollbacks, MCP, llms.txt, skill.md, Markdown export`},{name:`publish domain`,when:`Custom domain (mint add-domain), /docs subpath, reverse proxy, CSP`},{name:`publish repo`,when:`Monorepo, multi-repo, GitHub/GitLab/Bitbucket, offline export, self-host`},{name:`publish analytics`,when:`mint analytics, feedback, search data, analytics integrations`},{name:`publish assistant`,when:`AI assistant, widget, Assistant.md, skills, narration, own model`},{name:`access`,when:`Private docs, reader login, user groups, personalization`},{name:`access team`,when:`Team members, roles, SSO, SCIM, audit logs, session security`},{name:`automate`,when:`Keep docs in sync with code: agent, Autopilot, automations, Slack, CI`},{name:`migrate`,when:`Moving docs from Docusaurus, GitBook, ReadMe, Fern, Document360, Confluence, Markdown`},{name:`troubleshoot`,when:`An error, a failed build or deploy, or the site looks wrong`}],eg=()=>{let e=Math.max(...$h.map(({name:e})=>e.length))+2;return[`Usage: mint instructions <topic> [subtopic]`,``,...$h.map(({name:t,when:n})=>` ${t.padEnd(e)}${n}`),``].join(`
557
557
  `)},tg=e=>`https://www.mintlify.com/docs/mint-instructions/${e.map(encodeURIComponent).join(`/`)}.md`,ng=e=>e.replace(/^(?:>.*\n|\s*\n)*/,``);function rg(e){return Qh(this,void 0,void 0,function*(){let t=tg(e),n=yield fetch(t);if(n.status===404)throw Error(`no instructions for "${e.join(` `)}". Run \`mint instructions\` to list topics.`);if(!n.ok)throw Error(`failed to fetch ${t}: ${n.status} ${n.statusText}`);return ng(yield n.text())})}var ig=/* @__PURE__ */ t(m(),1);typeof navigator>`u`||navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const ag=`ERR_INVALID_ARG_VALUE`;function og(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}const sg=Symbol(),cg=Symbol(),lg=Symbol(),ug=new TextEncoder,dg=new TextDecoder;function fg(e){return typeof e==`string`?ug.encode(e):dg.decode(e)}let pg;if(Uint8Array.prototype.toBase64)pg=e=>(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e.toBase64({alphabet:`base64url`,omitPadding:!0}));else{let e=32768;pg=t=>{t instanceof ArrayBuffer&&(t=new Uint8Array(t));let n=[];for(let r=0;r<t.byteLength;r+=e)n.push(String.fromCharCode.apply(null,t.subarray(r,r+e)));return btoa(n.join(``)).replace(/=/g,``).replace(/\+/g,`-`).replace(/\//g,`_`)}}let mg;mg=Uint8Array.fromBase64?e=>{try{return Uint8Array.fromBase64(e,{alphabet:`base64url`})}catch(e){throw og(`The input to be decoded is not correctly encoded.`,ag,e)}}:e=>{try{let t=atob(e.replace(/-/g,`+`).replace(/_/g,`/`).replace(/\s/g,``)),n=new Uint8Array(t.length);for(let e=0;e<t.length;e++)n[e]=t.charCodeAt(e);return n}catch(e){throw og(`The input to be decoded is not correctly encoded.`,ag,e)}};function hg(e){return typeof e==`string`?mg(e):pg(e)}var gg=class extends Error{code;constructor(e,t){super(e,t),this.name=this.constructor.name,t?.code&&(this.code=t?.code),Error.captureStackTrace?.(this,this.constructor)}};function _g(e,t,n){return new gg(e,{code:t,cause:n})}function vg(e,t,n,r){try{if(typeof e!=`string`)throw og(`${t} must be a string`,`ERR_INVALID_ARG_TYPE`,r);if(e.length===0)throw og(`${t} must not be empty`,ag,r)}catch(e){throw n?_g(e.message,n,r):e}}function yg(){return hg(crypto.getRandomValues(/* @__PURE__ */ new Uint8Array(32)))}function bg(){return yg()}function xg(){return yg()}function Sg(){return yg()}async function Cg(e){return vg(e,`codeVerifier`),hg(await crypto.subtle.digest(`SHA-256`,fg(e)))}function wg(e){return vg(e,`"clientSecret"`),(t,n,r,i)=>{r.set(`client_id`,n.client_id),r.set(`client_secret`,e)}}function Tg(){return(e,t,n,r)=>{n.set(`client_id`,t.client_id)}}URL.parse;const Eg=Symbol();typeof navigator<`u`&&navigator.userAgent?.startsWith?.(`Mozilla/5.0 `);const Dg=e=>Og.get(e);let Og,kg;function Ag(e){return e===void 0?(kg||=/* @__PURE__ */ new WeakMap,(e,t,n,r)=>{let i;return(i=kg.get(t))||(jg(t.client_secret,`"metadata.client_secret"`),i=wg(t.client_secret),kg.set(t,i)),i(e,t,n,r)}):wg(e)}function jg(e,t){if(typeof e!=`string`)throw Ig(`${t} must be a string`,Fg);if(e.length===0)throw Ig(`${t} must not be empty`,Pg)}function Mg(){return Tg()}const Ng=lg,Pg=`ERR_INVALID_ARG_VALUE`,Fg=`ERR_INVALID_ARG_TYPE`;function Ig(e,t,n){let r=TypeError(e,{cause:n});return Object.assign(r,{code:t}),r}function Lg(e){return Cg(e)}function Rg(){return bg()}function zg(){return Sg()}function Bg(){return xg()}new TextDecoder;function Vg(e){return{supportsPKCE:{__proto__:null,value(t=`S256`){return e.code_challenge_methods_supported?.includes(t)===!0}}}}function Hg(e){Object.defineProperties(e,Vg(e))}const Ug=Symbol();Object.freeze(class{constructor(e,t,n,r){if(typeof t!=`string`||!t.length)throw Ig(`"clientId" must be a non-empty string`,Fg);if(typeof n==`string`&&(n={client_secret:n}),n?.client_id!==void 0&&t!==n.client_id)throw Ig(`"clientId" and "metadata.client_id" must be the same`,Pg);let i={...structuredClone(n),client_id:t};i[sg]=n?.[sg]??0,i[cg]=n?.[cg]??30;let a;a=r||(typeof i.client_secret==`string`&&i.client_secret.length?Ag(i.client_secret):Mg());let o=Object.freeze(i),s=structuredClone(e);Ug in e&&(s[Eg]=({claims:{tid:t}})=>e.issuer.replace(`{tenantid}`,t));let c=Object.freeze(s);Og||=/* @__PURE__ */ new WeakMap,Og.set(this,{__proto__:null,as:c,c:o,auth:a,tlsOnly:!0,jwksCache:{}})}serverMetadata(){let e=structuredClone(Dg(this).as);return Hg(e),e}clientMetadata(){return structuredClone(Dg(this).c)}get timeout(){return Dg(this).timeout}set timeout(e){Dg(this).timeout=e}get[Ng](){return Dg(this).fetch}set[Ng](e){Dg(this).fetch=e}}.prototype);var Wg=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function Gg(){return Wg(this,void 0,void 0,function*(){let{default:e}=yield import(`http`),t,n,r=!1,i=new Promise((e,r)=>{t=e,n=r}),a=e.createServer((e,n)=>{if(n.setHeader(`Access-Control-Allow-Origin`,it),n.setHeader(`Access-Control-Allow-Methods`,`POST, OPTIONS`),n.setHeader(`Access-Control-Allow-Headers`,`Content-Type`),e.method===`OPTIONS`)n.writeHead(204),n.end();else if(e.method===`POST`){let i=``;e.on(`data`,e=>{i+=e}),e.on(`end`,()=>{try{let{code:e}=JSON.parse(i);n.writeHead(200,{"Content-Type":`application/json`}),n.end(JSON.stringify({ok:!0})),r=!0,a.close(),t(e)}catch{n.writeHead(400),n.end(JSON.stringify({error:`invalid body`}))}})}else n.writeHead(405),n.end()});return a.listen(pt,`localhost`),{codePromise:i,close:()=>{r||(r=!0,a.close(),n(/* @__PURE__ */ Error(`Login cancelled`)))}}})}var Kg=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function qg(){return Kg(this,arguments,void 0,function*({signup:e=!1}={}){let t=Rg(),n=yield Lg(t),r=zg(),i=Bg(),a=Buffer.from(JSON.stringify({nonce:r,clientState:i})).toString(`base64url`),s=new URL(`/api/cli/oauth/authorize`,it);s.searchParams.set(`state`,a),s.searchParams.set(`code_challenge`,n),e&&s.searchParams.set(`flow`,`cli-signup`);let l=new URL(`/signup`,it);l.searchParams.set(`next`,`${s.pathname}${s.search}`);let u=(e?l:s).toString();pd();let{codePromise:d,close:f}=yield Gg();D((0,P.jsxs)(ke,{flexDirection:`column`,gap:1,paddingY:1,children:[(0,P.jsxs)(M,{bold:!0,children:[(0,P.jsx)(M,{color:`green`,children:`◆ `}),`A browser window will open to`,` `,e?`create your Mintlify account`:`authenticate with Mintlify`]}),(0,P.jsxs)(ke,{flexDirection:`column`,paddingLeft:3,gap:1,children:[(0,P.jsx)(M,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL:`}),(0,P.jsx)(M,{dimColor:!0,children:u})]})]})),(0,ig.default)(u).catch(()=>{}),D((0,P.jsxs)(ke,{flexDirection:`column`,paddingLeft:1,marginTop:1,children:[(0,P.jsx)(M,{dimColor:!0,children:`╭─ Paste the authorization code from your browser`}),(0,P.jsx)(M,{dimColor:!0,children:`│`})]})),yield new Promise(e=>setTimeout(e,50));let p=It({message:`█`,theme:{prefix:w.dim(` │`),style:{answer:e=>w.cyan(e)}}}),m;try{m=yield Promise.race([d,p])}catch{f(),p.cancel(),D((0,P.jsx)(c,{message:`login cancelled`}));return}f(),p.cancel();let h=yield fetch(xt,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({grant_type:`authorization_code`,code:m,code_verifier:t})}),g=yield h.json().catch(()=>({}));if(!h.ok){let e=g.error_message??g.error??`unknown error`;hd(e),D((0,P.jsx)(c,{message:`login failed: ${e}`}));return}let _=g;yield Jl(_.access_token,_.refresh_token,eu(_.id_token)??null),e&&(yield gt(`subdomain`).catch(()=>void 0)),md(),D((0,P.jsx)(o,{message:e?`account created and logged in successfully`:`logged in successfully`})),yield Yg(_.access_token)})}function Jg(e){return e instanceof Error&&e.name===`ExitPromptError`}function Yg(e){return Kg(this,void 0,void 0,function*(){let t=yield fu(e);if(t.length===0)return;if(t.length===1){yield lt(`subdomain`,t[0]),D((0,P.jsx)(u,{message:`default project set to ${t[0]}`}));return}yield new Promise(e=>setTimeout(e,50));let n;try{n=yield Vt({message:`Select a default project`,source:e=>(e?t.filter(t=>t.toLowerCase().includes(e.toLowerCase())):t).map(e=>({name:e,value:e}))})}catch(e){if(Jg(e)){D((0,P.jsx)(u,{message:`No project set. To set a default project, run ${w.bold(`mintlify config set subdomain <subdomain>`)}`}));return}throw e}yield lt(`subdomain`,n),D((0,P.jsx)(u,{message:`default project set to ${n}`}))})}var Xg=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};function Zg(){return Xg(this,void 0,void 0,function*(){yield $l(),D((0,P.jsx)(o,{message:`logged out successfully`}))})}var Qg=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const $g=(e,t)=>{let n=[],r=()=>t=>(pn(t,t=>{if(t.type===`image`){t.alt&&t.alt.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`img`,tagName:`image (markdown)`});return}let r=t;if(r.name===`img`||r.name===`video`){let i=r.attributes.findIndex(e=>e.type===`mdxJsxAttribute`&&e.name===`alt`),a=r.attributes[i];a&&typeof a.value==`string`&&a.value.trim()!==``||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:r.name,tagName:r.name})}else if(r.name===`a`){let i=e=>e.some(e=>e.type===`text`?e.value.trim()!==``:`children`in e&&Array.isArray(e.children)?i(e.children):!1);i(r.children)||n.push({filePath:e,line:t.position?.start.line,column:t.position?.start.column,element:`a`,tagName:`<a>`})}}),t);try{let e=t.replace(/^( {0,3}#{1,6}\s+.+?)\s*\{#[^}]+\}\s*$/gm,`$1`);A().use(r).processSync(e)}catch(t){console.warn(`Warning: Could not parse ${e}: ${t}`)}return n},e_=(...e)=>Qg(void 0,[...e],void 0,function*(e=process.cwd()){let t=yield ge(e),{contentFilenames:n}=yield fe(e,t),r=[];for(let t of n)r.push(kn.join(e,t));let i=[],a=/* @__PURE__ */ new Set;for(let e of r)try{let t=Jn.readFileSync(e,`utf-8`),n=$g(e,t);n.length>0&&(i.push(...n),a.add(e))}catch(t){console.warn(`Warning: Could not read file ${e}: ${t}`)}return{missingAltAttributes:i,totalFiles:r.length,filesWithIssues:a.size}});var t_=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const n_=()=>t_(void 0,void 0,void 0,function*(){try{D((0,P.jsx)(M,{bold:!0,color:`cyan`,children:`Checking mdx files for accessibility issues...`}));let e=yield e_();if(e.missingAltAttributes.length===0)return D((0,P.jsx)(o,{message:`no accessibility issues found`})),D((0,P.jsxs)(M,{children:[`Checked `,e.totalFiles,` MDX files - all images and videos have alt attributes.`]})),0;let t={};e.missingAltAttributes.forEach(e=>{var n;t[e.filePath]||(t[e.filePath]=[]),(n=t[e.filePath])==null||n.push(e)}),D((0,P.jsxs)(M,{bold:!0,color:`red`,children:[`Found `,e.missingAltAttributes.length,` accessibility issues in`,` `,e.filesWithIssues,` files:`]})),D((0,P.jsx)(M,{}));for(let[e,n]of Object.entries(t)){let t=kn.relative(process.cwd(),e);D((0,P.jsxs)(M,{bold:!0,children:[t,`:`]}));for(let e of n){let t=e.line&&e.column?` (line ${e.line}, col ${e.column})`:``;e.element===`a`?D((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{color:`red`,children:` ✗`}),` Missing text attribute `,(0,P.jsx)(M,{bold:!0,children:e.tagName}),` `,`element`,t]})):D((0,P.jsxs)(M,{children:[(0,P.jsx)(M,{color:`red`,children:` ✗`}),` Missing alt attribute on `,(0,P.jsx)(M,{bold:!0,children:e.tagName}),` `,`element`,t]}))}D((0,P.jsx)(M,{}))}return D((0,P.jsxs)(M,{color:`yellow`,children:[(0,P.jsx)(M,{bold:!0,children:`Recommendation:`}),` Add alt attributes to all images and videos for better accessibility.`]})),1}catch(e){return D((0,P.jsx)(c,{message:`MDX accessibility check failed: ${e instanceof Error?e.message:`Unknown error`}`})),1}});var r_=function(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})};const i_=/* @__PURE__ */ new Set([`page`,`site`,`openapi`]),a_=/* @__PURE__ */ new Set([`stats`,`search`,`feedback`,`conversation`]),o_=/* @__PURE__ */ new Set([`set`,`get`,`clear`]),s_=/* @__PURE__ */ new Set([`list`,`view`,`buckets`]),c_=/* @__PURE__ */ new Set([`list`,`view`]);function l_(e){let t=e.filter(e=>typeof e==`string`);if(t.length===0)return``;let n=t[0],r=t[1],i=t[2];if(n===`scrape`&&r!==void 0&&i_.has(r))return`scrape ${r}`;if(n===`config`&&r!==void 0&&o_.has(r))return`config ${r}`;if(n===`analytics`&&r!==void 0&&a_.has(r)){if(r===`conversation`&&i!==void 0&&s_.has(i)){let e=t[3];return i===`buckets`&&e!==void 0&&c_.has(e)?`analytics conversation buckets ${e}`:`analytics conversation ${i}`}return`analytics ${r}`}return n}function u_(){let e=!1;return function(t){return r_(this,void 0,void 0,function*(){if(typeof t._[0]==`string`){if(e)return;e=!0;let n=l_(t._),{cli:r}=Ke();dd({command:n,cliVersion:r,subdomain:mt(`subdomain`)})}})}}const d_=zn(new URL(`../migrate`,import.meta.url)),f_=(...e)=>jn(In.join(d_,...e),`utf8`),p_=e=>Mn(In.join(d_,e)).filter(e=>e.endsWith(`.md`)).map(e=>e.slice(0,-3)).sort(),m_=()=>[f_(`index.md`).trimEnd(),`Topics: ${p_(`topics`).join(`, `)}. Run \`mint migrate --topic <name>\`.`,`Sources: ${p_(`sources`).join(`, `)}. Run \`mint migrate --from <name>\`.`].join(`
558
558
 
@@ -4,4 +4,4 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- export{t as clearConfigValue,n as getAgentSiteMetadata,r as getConfigValue,i as getUpdateState,a as hasShownPublishPrompt,o as isTelemetryEnabled,s as markPublishPromptShown,c as setAgentSiteMetadata,l as setConfigValue,u as setTelemetryEnabled,d as setUpdateState}from"./config-DLwNRkEH.js";
7
+ export{t as clearConfigValue,n as getAgentSiteMetadata,r as getConfigValue,i as getUpdateState,a as hasShownPublishPrompt,o as isTelemetryEnabled,s as markPublishPromptShown,c as setAgentSiteMetadata,l as setConfigValue,u as setTelemetryEnabled,d as setUpdateState}from"./config-D-3PjtVl.js";
@@ -4,7 +4,7 @@ import { dirname as __mintDirname } from 'node:path';
4
4
  const require = __mintCreateRequire(import.meta.url);
5
5
  const __filename = __mintFileURLToPath(import.meta.url);
6
6
  const __dirname = __mintDirname(__filename);
7
- import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{K as r,Qn as i,Yn as a,ct as o,dr as s,dt as c,lt as l,nt as u,ut as d}from"./dist-Ds9rgRXa.js";import{D as f,G as p,L as m,R as h,W as g,g as _,i as v,nt as y,q as b,tt as x,y as S}from"./dist-Cgbskz5I.js";import{a as C,c as ee,i as te,o as ne,r as re,s as ie,t as ae}from"./agent-Da2kI1tZ.js";import{dt as oe}from"./utils-B1yewEzF.js";import{r as se}from"./client-DXQ6Tgw0.js";import{f as ce,m as le}from"./schemas-CVKidklE.js";import{createRequire as ue}from"node:module";import w from"path";import{readFileSync as de}from"node:fs";import fe,*as pe from"node:readline";import{AsyncLocalStorage as me,AsyncResource as he}from"node:async_hooks";import{spawn as ge,spawnSync as _e}from"child_process";import{execFile as ve}from"node:child_process";import ye from"node:os";import be from"node:path";import{randomUUID as xe}from"node:crypto";import{fileURLToPath as Se}from"node:url";import{promisify as Ce,stripVTControlCharacters as we}from"node:util";import Te from"node:fs/promises";import T from"node:process";import Ee,{readFileSync as De,unlinkSync as Oe,writeFileSync as ke}from"fs";import Ae from"os";var je=/* @__PURE__ */ n(((t,n)=>{var r=e(`os`),i=e(`fs`),a=e(`child_process`),o=`/etc/resolv.conf`;function s(){var e=`eth`,t=r.platform();return t===`darwin`?e=`en`:t===`win32`&&(e=null),e}function c(){return r.platform()===`win32`?`ipconfig/all`:`/sbin/ifconfig`}function l(e,t){return t===`IPv4`?e===`IPv4`||e===4:t===`IPv6`?e===`IPv6`||e===6:e===t}function u(e,t){typeof e==`function`&&(t=e,e=null);var n={ip:u.ip(e),ipv6:u.ipv6(e),mac:null};u.mac(e,function(e,r){r&&(n.mac=r),t(e,n)})}u.interface=function(e,t){var n=r.networkInterfaces(),i=!t;t||=s(),e||=`IPv4`;for(var a=-1;a<8;a++){var o=n[t+(a>=0?a:``)];if(o)for(var c=0;c<o.length;c++){var u=o[c];if(l(u.family,e))return u}}if(i)for(var d in n)for(var o=n[d],a=0;a<o.length;a++){var u=o[a];if(l(u.family,e)&&!u.address.startsWith(`127.`))return u}},u.ip=function(e){var t=u.interface(`IPv4`,e);return t&&t.address},u.ipv6=function(e){var t=u.interface(`IPv6`,e);return t&&t.address};var d=/^(\w+)\:\s+flags=/,f=/^(\w+)\s{2,}link encap:\w+/i,p=u.MAC_RE=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,m=u.MAC_IP_RE=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function h(e,t,n){for(var r=e.split(`
7
+ import{i as e,o as t,t as n}from"./rolldown-runtime-CEAe2Uac.js";import{K as r,Qn as i,Yn as a,ct as o,dr as s,dt as c,lt as l,nt as u,ut as d}from"./dist-BAndNTcP.js";import{D as f,G as p,L as m,R as h,W as g,g as _,i as v,nt as y,q as b,tt as x,y as S}from"./dist-DxjIV9Q5.js";import{a as C,c as ee,i as te,o as ne,r as re,s as ie,t as ae}from"./agent-Da2kI1tZ.js";import{dt as oe}from"./utils-B1yewEzF.js";import{r as se}from"./client-DXQ6Tgw0.js";import{f as ce,m as le}from"./schemas-CVKidklE.js";import{createRequire as ue}from"node:module";import w from"path";import{readFileSync as de}from"node:fs";import fe,*as pe from"node:readline";import{AsyncLocalStorage as me,AsyncResource as he}from"node:async_hooks";import{spawn as ge,spawnSync as _e}from"child_process";import{execFile as ve}from"node:child_process";import ye from"node:os";import be from"node:path";import{randomUUID as xe}from"node:crypto";import{fileURLToPath as Se}from"node:url";import{promisify as Ce,stripVTControlCharacters as we}from"node:util";import Te from"node:fs/promises";import T from"node:process";import Ee,{readFileSync as De,unlinkSync as Oe,writeFileSync as ke}from"fs";import Ae from"os";var je=/* @__PURE__ */ n(((t,n)=>{var r=e(`os`),i=e(`fs`),a=e(`child_process`),o=`/etc/resolv.conf`;function s(){var e=`eth`,t=r.platform();return t===`darwin`?e=`en`:t===`win32`&&(e=null),e}function c(){return r.platform()===`win32`?`ipconfig/all`:`/sbin/ifconfig`}function l(e,t){return t===`IPv4`?e===`IPv4`||e===4:t===`IPv6`?e===`IPv6`||e===6:e===t}function u(e,t){typeof e==`function`&&(t=e,e=null);var n={ip:u.ip(e),ipv6:u.ipv6(e),mac:null};u.mac(e,function(e,r){r&&(n.mac=r),t(e,n)})}u.interface=function(e,t){var n=r.networkInterfaces(),i=!t;t||=s(),e||=`IPv4`;for(var a=-1;a<8;a++){var o=n[t+(a>=0?a:``)];if(o)for(var c=0;c<o.length;c++){var u=o[c];if(l(u.family,e))return u}}if(i)for(var d in n)for(var o=n[d],a=0;a<o.length;a++){var u=o[a];if(l(u.family,e)&&!u.address.startsWith(`127.`))return u}},u.ip=function(e){var t=u.interface(`IPv4`,e);return t&&t.address},u.ipv6=function(e){var t=u.interface(`IPv6`,e);return t&&t.address};var d=/^(\w+)\:\s+flags=/,f=/^(\w+)\s{2,}link encap:\w+/i,p=u.MAC_RE=/(?:ether|HWaddr)\s+((?:[a-z0-9]{2}\:){5}[a-z0-9]{2})/i,m=u.MAC_IP_RE=/inet\s(?:addr\:)?(\d+\.\d+\.\d+\.\d+)/;function h(e,t,n){for(var r=e.split(`
8
8
  `),i=0;i<r.length;i++){var a=r[i].trimRight(),o=d.exec(a)||f.exec(a);if(o&&o[1].indexOf(t)===0){var s=null,c=null,l=p.exec(a);for(l&&(c=l[1]),i++;;){if(a=r[i],!a||d.exec(a)||f.exec(a)){i--;break}c||(l=p.exec(a),l&&(c=l[1])),s||(l=m.exec(a),l&&(s=l[1])),i++}if(s===n)return c}}}u.mac=function(e,t){typeof e==`function`&&(t=e,e=null),e||=s();var n=u.interface(`IPv4`,e);if(!n)return t();if(process.env.CI||n.mac!==`ff:00:00:00:00:00`&&n.mac!==`00:00:00:00:00:00`||(n.mac=``),n.mac)return t(null,n.mac);a.exec(c(),{timeout:5e3},function(r,i,a){if(r||!i)return t(r);var o=h(i||``,e,n.address);t(null,o)})};var g=/^nameserver\s+(\d+\.\d+\.\d+\.\d+)$/i;u.dns=function(e,t){typeof e==`function`&&(t=e,e=null),e||=o,i.readFile(e,`utf8`,function(e,n){if(e)return t(e);var r=[];n||=``;for(var i=n.split(`
9
9
  `),a=0;a<i.length;a++){var o=i[a].trim(),s=g.exec(o);s&&r.push(s[1])}t(null,r)})},n.exports=u})),Me=/* @__PURE__ */ n(((t,n)=>{let r=e(`net`),i=je(),a=v()(`detect-port`);n.exports=(e,t)=>{let n=``;typeof e==`object`&&e?(n=e.hostname,t=e.callback,e=e.port):typeof e==`function`&&(t=e,e=null),e=parseInt(e)||0;let r=e+10;return r>65535&&(r=65535),a(`detect free port between [%s, %s)`,e,r),typeof t==`function`?o(e,r,n,t):new Promise(t=>{o(e,r,n,(e,n)=>{t(n)})})};function o(e,t,n,r){function c(){e++,e>=t&&(a(`port: %s >= maxPort: %s, give up and use random port`,e,t),e=0,t=0),o(e,t,n,r)}n?s(e,n,(e,t)=>{if(e)return e.code===`EADDRNOTAVAIL`?r(/* @__PURE__ */ Error(`the ip that is not unknown on the machine`)):c();r(null,t)}):s(e,null,(t,n)=>{if(e===0)return r(t,n);if(t)return c(t);s(e,`0.0.0.0`,t=>{if(t)return c(t);s(e,`localhost`,t=>{if(t&&t.code!==`EADDRNOTAVAIL`)return c(t);s(e,i.ip(),(e,t)=>{if(e)return c(e);r(null,t)})})})})}function s(e,t,n){let i=new r.Server;i.on(`error`,r=>(a(`listen %s:%s error: %s`,t,e,r),i.close(),r.code===`ENOTFOUND`?(a(`ignore dns ENOTFOUND error, get free %s:%s`,t,e),n(null,e)):n(r))),i.listen(e,t,()=>(e=i.address().port,i.close(),a(`get free %s:%s`,t,e),n(null,e)))}})),Ne=/* @__PURE__ */ n(((e,t)=>{let n=v()(`wait-port`),r=Me(),i=e=>new Promise(t=>setTimeout(t,e));async function a(e,t={}){let{retryInterval:a=1e3,retries:o=1/0}=t,s=1;async function c(){if(n(`retries`,o,`count`,s),s>o){let e=/* @__PURE__ */ Error(`retries exceeded`);throw e.retries=o,e.count=s,e}return s++,await r(e)!==e||(await i(a),c())}return await c()}t.exports=a})),Pe=/* @__PURE__ */ n(((e,t)=>{t.exports=Me(),t.exports.waitPort=Ne()})),E=/* @__PURE__ */ n((e=>{let t=c().fromCallback,n=d(),r=(/* @__PURE__ */ `access.appendFile.chmod.chown.close.copyFile.fchmod.fchown.fdatasync.fstat.fsync.ftruncate.futimes.lchmod.lchown.link.lstat.mkdir.mkdtemp.open.opendir.readdir.readFile.readlink.realpath.rename.rm.rmdir.stat.symlink.truncate.unlink.utimes.writeFile`.split(`.`)).filter(e=>typeof n[e]==`function`);Object.assign(e,n),r.forEach(r=>{e[r]=t(n[r])}),e.exists=function(e,t){return typeof t==`function`?n.exists(e,t):new Promise(t=>n.exists(e,t))},e.read=function(e,t,r,i,a,o){return typeof o==`function`?n.read(e,t,r,i,a,o):new Promise((o,s)=>{n.read(e,t,r,i,a,(e,t,n)=>{if(e)return s(e);o({bytesRead:t,buffer:n})})})},e.write=function(e,t,...r){return typeof r[r.length-1]==`function`?n.write(e,t,...r):new Promise((i,a)=>{n.write(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffer:n})})})},e.readv=function(e,t,...r){return typeof r[r.length-1]==`function`?n.readv(e,t,...r):new Promise((i,a)=>{n.readv(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesRead:t,buffers:n})})})},e.writev=function(e,t,...r){return typeof r[r.length-1]==`function`?n.writev(e,t,...r):new Promise((i,a)=>{n.writev(e,t,...r,(e,t,n)=>{if(e)return a(e);i({bytesWritten:t,buffers:n})})})},typeof n.realpath.native==`function`?e.realpath.native=t(n.realpath.native):process.emitWarning(`fs.realpath.native is not a function. Is fs being monkey-patched?`,`Warning`,`fs-extra-WARN0003`)})),Fe=/* @__PURE__ */ n(((t,n)=>{let r=e(`path`);n.exports.checkPath=function(e){if(process.platform===`win32`&&/[<>:"|?*]/.test(e.replace(r.parse(e).root,``))){let t=/* @__PURE__ */ Error(`Path contains invalid characters: ${e}`);throw t.code=`EINVAL`,t}}})),Ie=/* @__PURE__ */ n(((e,t)=>{let n=E(),{checkPath:r}=Fe(),i=e=>typeof e==`number`?e:{mode:511,...e}.mode;t.exports.makeDir=async(e,t)=>(r(e),n.mkdir(e,{mode:i(t),recursive:!0})),t.exports.makeDirSync=(e,t)=>(r(e),n.mkdirSync(e,{mode:i(t),recursive:!0}))})),D=/* @__PURE__ */ n(((e,t)=>{let n=c().fromPromise,{makeDir:r,makeDirSync:i}=Ie(),a=n(r);t.exports={mkdirs:a,mkdirsSync:i,mkdirp:a,mkdirpSync:i,ensureDir:a,ensureDirSync:i}})),Le=/* @__PURE__ */ n(((e,t)=>{let n=c().fromPromise,r=E();function i(e){return r.access(e).then(()=>!0).catch(()=>!1)}t.exports={pathExists:n(i),pathExistsSync:r.existsSync}})),Re=/* @__PURE__ */ n(((e,t)=>{let n=E(),r=c().fromPromise;async function i(e,t,r){let i=await n.open(e,`r+`),a=null;try{await n.futimes(i,t,r)}finally{try{await n.close(i)}catch(e){a=e}}if(a)throw a}function a(e,t,r){let i=n.openSync(e,`r+`);return n.futimesSync(i,t,r),n.closeSync(i)}t.exports={utimesMillis:r(i),utimesMillisSync:a}})),ze=/* @__PURE__ */ n(((t,n)=>{let r=E(),i=e(`path`),a=c().fromPromise;function o(e,t,n){let i=n.dereference?e=>r.stat(e,{bigint:!0}):e=>r.lstat(e,{bigint:!0});return Promise.all([i(e),i(t).catch(e=>{if(e.code===`ENOENT`)return null;throw e})]).then(([e,t])=>({srcStat:e,destStat:t}))}function s(e,t,n){let i,a=n.dereference?e=>r.statSync(e,{bigint:!0}):e=>r.lstatSync(e,{bigint:!0}),o=a(e);try{i=a(t)}catch(e){if(e.code===`ENOENT`)return{srcStat:o,destStat:null};throw e}return{srcStat:o,destStat:i}}async function l(e,t,n,r){let{srcStat:a,destStat:s}=await o(e,t,r);if(s){if(p(a,s)){let r=i.basename(e),o=i.basename(t);if(n===`move`&&r!==o&&r.toLowerCase()===o.toLowerCase())return{srcStat:a,destStat:s,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!s.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&s.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&m(e,t))throw Error(h(e,t,n));return{srcStat:a,destStat:s}}function u(e,t,n,r){let{srcStat:a,destStat:o}=s(e,t,r);if(o){if(p(a,o)){let r=i.basename(e),s=i.basename(t);if(n===`move`&&r!==s&&r.toLowerCase()===s.toLowerCase())return{srcStat:a,destStat:o,isChangingCase:!0};throw Error(`Source and destination must not be the same.`)}if(a.isDirectory()&&!o.isDirectory())throw Error(`Cannot overwrite non-directory '${t}' with directory '${e}'.`);if(!a.isDirectory()&&o.isDirectory())throw Error(`Cannot overwrite directory '${t}' with non-directory '${e}'.`)}if(a.isDirectory()&&m(e,t))throw Error(h(e,t,n));return{srcStat:a,destStat:o}}async function d(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=await r.stat(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(p(t,c))throw Error(h(e,n,a));return d(e,t,s,a)}function f(e,t,n,a){let o=i.resolve(i.dirname(e)),s=i.resolve(i.dirname(n));if(s===o||s===i.parse(s).root)return;let c;try{c=r.statSync(s,{bigint:!0})}catch(e){if(e.code===`ENOENT`)return;throw e}if(p(t,c))throw Error(h(e,n,a));return f(e,t,s,a)}function p(e,t){return t.ino&&t.dev&&t.ino===e.ino&&t.dev===e.dev}function m(e,t){let n=i.resolve(e).split(i.sep).filter(e=>e),r=i.resolve(t).split(i.sep).filter(e=>e);return n.every((e,t)=>r[t]===e)}function h(e,t,n){return`Cannot ${n} '${e}' to a subdirectory of itself, '${t}'.`}n.exports={checkPaths:a(l),checkPathsSync:u,checkParentPaths:a(d),checkParentPathsSync:f,isSrcSubdir:m,areIdentical:p}})),Be=/* @__PURE__ */ n(((t,n)=>{let r=E(),i=e(`path`),{mkdirs:a}=D(),{pathExists:o}=Le(),{utimesMillis:s}=Re(),c=ze();async function l(e,t,n={}){typeof n==`function`&&(n={filter:n}),n.clobber=`clobber`in n?!!n.clobber:!0,n.overwrite=`overwrite`in n?!!n.overwrite:n.clobber,n.preserveTimestamps&&process.arch===`ia32`&&process.emitWarning(`Using the preserveTimestamps option in 32-bit node is not recommended;
10
10